From c2ea4463ab4ce04936a824f7e8c7c133aabe1381 Mon Sep 17 00:00:00 2001 From: Susant Palai Date: Tue, 11 Apr 2017 17:27:17 +0530 Subject: cluster/dht: Make rebalance honor min-free-disk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test: Manual created files of size 1K on 2 brick(of size 1GB) setup . added a brick of size 16GB. set min-free-disk to 12GB(so that first two bricks won't receive any files). removed one of the 1st brick of size 1GB. Logs from test: [2017-04-12 08:52:08.196484] W [MSGID: 0] [dht-rebalance.c:895:__dht_check_free_space] 0-test1-dht: Write will cross min-free-disk for file - /tile32 on subvol - test1-client-1. Looking for new subvol. [2017-04-12 08:52:08.196904] I [MSGID: 0] [dht-rebalance.c:925:__dht_check_free_space] 0-test1-dht: new target found - test1-client-2 for file - /tile32 - Post migration we have two files. The new destination (/brick/1) has the data file [root@vm1 ~]# ll /brick/1/tile32 -rw-r--r--. 2 root root 0 Apr 12 14:22 /brick/1/tile32 - On the old target the linkto file is there with linkto xattr pointing to /brick/1 [root@vm1 ~]# ll /tmp/2/tile32 ---------T. 2 root root 1000 Apr 12 14:22 /tmp/2/tile32 [root@vm1 ~]# getfattr -m . -de text /tmp/2/tile32 getfattr: Removing leading '/' from absolute path names security.selinux="unconfined_u:object_r:user_tmp_t:s0" trusted.gfid="����:Aс�#�/'b2" trusted.glusterfs.dht.linkto="test1-client-2" Marking ./tests/features/worm_sh.t as bad test. Reason being, this patch failed on master branch as well and it has nothing to do with rebalance/remove-brick. BUG: 1441508 Change-Id: I90bae251cda3d957a49cdceda90cd08311a392fb Signed-off-by: Susant Palai Reviewed-on: https://review.gluster.org/17034 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Amar Tumballi Reviewed-by: Raghavendra G CentOS-regression: Gluster Build System --- tests/bugs/distribute/bug-1161311.t | 25 +++++++++++++++++++++++-- tests/features/worm_sh.t | 2 ++ 2 files changed, 25 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/bugs/distribute/bug-1161311.t b/tests/bugs/distribute/bug-1161311.t index 8cf905a8f0b..8db66351ebe 100755 --- a/tests/bugs/distribute/bug-1161311.t +++ b/tests/bugs/distribute/bug-1161311.t @@ -15,6 +15,27 @@ . $(dirname $0)/../../include.rc . $(dirname $0)/../../volume.rc +cleanup +TEST truncate -s 10GB $B0/brick1 +TEST truncate -s 10GB $B0/brick2 +TEST truncate -s 10GB $B0/brick3 + +TEST LO1=`SETUP_LOOP $B0/brick1` +TEST MKFS_LOOP $LO1 + +TEST LO2=`SETUP_LOOP $B0/brick2` +TEST MKFS_LOOP $LO2 + +TEST LO3=`SETUP_LOOP $B0/brick3` +TEST MKFS_LOOP $LO3 + +TEST mkdir -p $B0/${V0}1 $B0/${V0}2 $B0/${V0}3 + + +TEST MOUNT_LOOP $LO1 $B0/${V0}1 +TEST MOUNT_LOOP $LO2 $B0/${V0}2 +TEST MOUNT_LOOP $LO3 $B0/${V0}3 + checksticky () { i=0; while [ ! -k $1 ]; do @@ -31,7 +52,6 @@ checksticky () { return 0 } -cleanup; TEST glusterd TEST pidof glusterd @@ -131,5 +151,6 @@ TEST ln ./dir1/FILE7 ./FILE7 cd / linkcountsrc=$(stat -c %h $M0/dir1/FILE1) TEST [[ $linkcountsrc == 14 ]] - +UMOUNT_LOOP ${B0}/${V0}{1..3} +rm -f ${B0}/brick{1..3} cleanup; diff --git a/tests/features/worm_sh.t b/tests/features/worm_sh.t index da7afc084b2..76e751b235d 100644 --- a/tests/features/worm_sh.t +++ b/tests/features/worm_sh.t @@ -73,3 +73,5 @@ EXPECT "qwerty" get_text_xattr user.test $B0/${V0}1/file3 EXPECT "qwerty" get_text_xattr user.test $B0/${V0}0/file3 cleanup; +#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000 +#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000 -- cgit