summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-09-07 12:43:07 +0530
committerDan Lambright <dlambrig@redhat.com>2015-09-22 04:59:53 -0700
commit7e1a00990324a5d7b1fa001bdea24a456fc1aa05 (patch)
treedd52d7b915ab6e1b5d71d20ce52558d08ccd7359 /tests
parent139732c40fda1424d95146d69328148775e61540 (diff)
marker: don't account destination linkto-file during internal migration
This is a backport of http://review.gluster.org/#/c/12113/ During a DHT re-balance operation, quota accounts for the destination. Problem of accounting this destination file are: 1) Migration is an internal operation, 'quota list' shows more usage on the CLI and this will come to the normal numbers once the migration is complete 2) If the usage is close to the limit set, then we can get 'Disk Quota Exceeded' errors in the I/O path during file migration Solution is we should not account of the usage on the destination file during migration, at the end of the migration. We need to reduce size of the source directory and accounting for the migrated dest file We assume that there are sufficent disk space in the back-end. DHT migrator should make sure that there are sufficient disk space before it starts the migration process. > Change-Id: Ie3cfe3e4ab5241c2a127ba0edc599a053d30c3a0 > BUG: 1260545 > Signed-off-by: vmallika <vmallika@redhat.com> Change-Id: I2254392ada61a40ce259003c6b5787ecf6dc6376 BUG: 1260919 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/12204 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/quota/bug-1260545.t59
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/bugs/quota/bug-1260545.t b/tests/bugs/quota/bug-1260545.t
new file mode 100644
index 00000000000..7cd137dda61
--- /dev/null
+++ b/tests/bugs/quota/bug-1260545.t
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+. $(dirname $0)/../../include.rc
+. $(dirname $0)/../../volume.rc
+
+cleanup;
+
+QDD=$(dirname $0)/quota
+# compile the test write program and run it
+build_tester $(dirname $0)/../../basic/quota.c -o $QDD
+
+TEST glusterd
+TEST pidof glusterd;
+TEST $CLI volume info;
+
+TEST $CLI volume create $V0 $H0:$B0/${V0}1 $H0:$B0/${V0}2;
+TEST $CLI volume start $V0;
+
+TEST $CLI volume quota $V0 enable;
+
+TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0;
+
+TEST $CLI volume quota $V0 limit-usage / 15MB
+TEST $CLI volume quota $V0 hard-timeout 0
+TEST $CLI volume quota $V0 soft-timeout 0
+
+TEST $QDD $M0/f1 256 40
+
+EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quotausage "/"
+
+if [ -f "$B0/${V0}1/f1" ]; then
+ HASHED="$B0/${V0}1"
+ OTHER="$B0/${V0}2"
+else
+ HASHED="$B0/${V0}2"
+ OTHER="$B0/${V0}1"
+fi
+
+TEST $CLI volume remove-brick $V0 $H0:${HASHED} start
+EXPECT_WITHIN $REBALANCE_TIMEOUT "completed" remove_brick_status_completed_field "$V0" "$H0:${HASHED}";
+
+#check consistency in mount point and also check that file is migrated to OTHER
+TEST [ -f "$OTHER/f1" ];
+TEST [ -f "$M0/f1" ];
+
+#check that remove-brick status should not have any failed or skipped files
+var=`$CLI volume remove-brick $V0 $H0:${HASHED} status | grep completed`
+TEST [ `echo $var | awk '{print $5}'` = "0" ]
+TEST [ `echo $var | awk '{print $6}'` = "0" ]
+
+EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quotausage "/"
+
+rm -f $M0/f1
+TEST $CLI volume stop $V0
+TEST $CLI volume delete $V0
+EXPECT "1" get_aux
+
+rm -f $QDD
+cleanup;