From 6a5d9764e687b74b0686d492120584e88a6f8110 Mon Sep 17 00:00:00 2001 From: Saravanakumar Arumugam Date: Fri, 8 Jul 2016 19:10:45 +0530 Subject: geo-rep: filter out xtime attribute during getxattr georep gsyncd's xtime needs to filtered irrespective of any process access. This way, we can avoid (unnecessarily)syncing xtime attribute to slave, which may raise permission denied errors. test case modified to check for xtime xattr only in backend. Back port of> >Change-Id: I2390b703048d5cc747d91fa2ae884dc55de58669 >BUG: 1353952 >Signed-off-by: Saravanakumar Arumugam >Signed-off-by: Mohammed Rafi KC >Reviewed-on: https://review.gluster.org/14880 >Smoke: Gluster Build System >Reviewed-by: Kotresh HR >Tested-by: Kotresh HR >NetBSD-regression: NetBSD Build System >CentOS-regression: Gluster Build System >Reviewed-by: Pranith Kumar Karampuri Change-Id: Ibdee6f3093648a7e0fb1e2b6be8172e604ab657f BUG: 1441574 Signed-off-by: Mohammed Rafi KC Reviewed-on: https://review.gluster.org/17045 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Kotresh HR Reviewed-by: Niels de Vos --- tests/basic/geo-replication/marker-xattrs.t | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'tests/basic') diff --git a/tests/basic/geo-replication/marker-xattrs.t b/tests/basic/geo-replication/marker-xattrs.t index dd5483d7e95..e5b26a6bd5b 100755 --- a/tests/basic/geo-replication/marker-xattrs.t +++ b/tests/basic/geo-replication/marker-xattrs.t @@ -24,11 +24,11 @@ TEST touch $M0 vol_uuid=$(get_volume_mark $M1) xtime=trusted.glusterfs.$vol_uuid.xtime -TEST "getfattr -n $xtime $M1 | grep -q ${xtime}=" +TEST "getfattr -n $xtime $B0/${V0}-1 | grep -q ${xtime}=" TEST kill_brick $V0 $H0 $B0/${V0}-0 -TEST "getfattr -n $xtime $M1 | grep -q ${xtime}=" +TEST "getfattr -n $xtime $B0/${V0}-1 | grep -q ${xtime}=" TEST getfattr -d -m. -e hex $M1 EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 @@ -61,13 +61,13 @@ vol_uuid=$(get_volume_mark $M1) xtime=trusted.glusterfs.$vol_uuid.xtime stime=trusted.glusterfs.$vol_uuid.stime -stime_val=$(getfattr -e hex -n $xtime $M1 | grep ${xtime}= | cut -f2 -d'=') +stime_val=$(getfattr -e hex -n $xtime $B0/${V0}-1 | grep ${xtime}= | cut -f2 -d'=') TEST "setfattr -n $stime -v $stime_val $B0/${V0}-1" -TEST "getfattr -n $xtime $M1 | grep -q ${xtime}=" +TEST "getfattr -n $xtime $B0/${V0}-1 | grep -q ${xtime}=" TEST kill_brick $V0 $H0 $B0/${V0}-0 -TEST "getfattr -n $xtime $M1 | grep -q ${xtime}=" +TEST "getfattr -n $xtime $B0/${V0}-1 | grep -q ${xtime}=" TEST "getfattr -n $stime $M1 | grep -q ${stime}=" TEST getfattr -d -m. -e hex $M1 @@ -98,12 +98,9 @@ TEST touch $M0 vol_uuid=$(get_volume_mark $M1) xtime=trusted.glusterfs.$vol_uuid.xtime -TEST "getfattr -n $xtime $M1 | grep -q ${xtime}=" +TEST "getfattr -n $xtime $B0/${V0}-0 | grep -q ${xtime}=" -TEST kill_brick $V0 $H0 $B0/${V0}-0 - -#Stripe doesn't tolerate ENOTCONN -TEST ! "getfattr -n $xtime $M1 | grep -q ${xtime}=" +TEST "getfattr -n $xtime $B0/${V0}-1 | grep -q ${xtime}=" EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M1 -- cgit From 2dcb19813e7dbb2afd2f482ed9a3401371325b1d Mon Sep 17 00:00:00 2001 From: Sanoj Unnikrishnan Date: Wed, 22 Mar 2017 15:02:12 +0530 Subject: Fixes quota aux mount failure The aux mount is created on the first limit/remove_limit/list command and it remains until volume is stopped / deleted / (quota is disabled) , where we do a lazy unmount. If the process is uncleanly terminated, then the mount entry remains and we get (Transport disconnected) error on subsequent attempts to run quota list/limit-usage/remove commands. Second issue, There is also a risk of inadvertent rm -rf on the /var/run/gluster causing data loss for the user. Ideally, /var/run is a temp path for application use and should not cause any data loss to persistent storage. Solution: 1) unmount the aux mount after each use. 2) clean stale mount before mounting, if any. One caveat with doing mount/unmount on each command is that we cannot use same mount point for both list and limit commands. The reason for this is that list command needs mount to be accessible in cli after response from glusterd, So it could be unmounted by a limit command if executed in parallel (had we used same mount point) Hence we use separate mount points for list and limit commands. > Reviewed-on: https://review.gluster.org/16938 > NetBSD-regression: NetBSD Build System > Smoke: Gluster Build System > Reviewed-by: Manikandan Selvaganesh > CentOS-regression: Gluster Build System > Reviewed-by: Raghavendra G > Reviewed-by: Atin Mukherjee > (cherry picked from commit 2ae4b4058691b324535d802f4e6d24cce89a10e5) Change-Id: I4f9e39da2ac2b65941399bffb6440db8a6ba59d0 BUG: 1449782 Signed-off-by: Sanoj Unnikrishnan Reviewed-on: https://review.gluster.org/17242 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Raghavendra G --- tests/basic/ec/quota.t | 1 - tests/basic/quota-ancestry-building.t | 1 - tests/basic/quota-anon-fd-nfs.t | 1 - tests/basic/quota-nfs.t | 1 - tests/basic/quota.t | 6 ---- tests/basic/quota_aux_mount.t | 53 +++++++++++++++++++++++++++++++++++ 6 files changed, 53 insertions(+), 10 deletions(-) create mode 100755 tests/basic/quota_aux_mount.t (limited to 'tests/basic') diff --git a/tests/basic/ec/quota.t b/tests/basic/ec/quota.t index b023240b87e..c9612c8b76a 100755 --- a/tests/basic/ec/quota.t +++ b/tests/basic/ec/quota.t @@ -40,7 +40,6 @@ EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "8.0MB" quotausage "/test" TEST rm $M0/test/file2.txt EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "0Bytes" quotausage "/test" TEST $CLI volume stop $V0 -EXPECT "1" get_aux rm -f $QDD cleanup; diff --git a/tests/basic/quota-ancestry-building.t b/tests/basic/quota-ancestry-building.t index 99c971859e8..5d2f4a7dd66 100755 --- a/tests/basic/quota-ancestry-building.t +++ b/tests/basic/quota-ancestry-building.t @@ -65,7 +65,6 @@ exec 5>&- exec 6>&- TEST $CLI volume stop $V0 -EXPECT "1" get_aux rm -f $QDD cleanup; diff --git a/tests/basic/quota-anon-fd-nfs.t b/tests/basic/quota-anon-fd-nfs.t index c6b01553b02..d911cc90b87 100755 --- a/tests/basic/quota-anon-fd-nfs.t +++ b/tests/basic/quota-anon-fd-nfs.t @@ -98,7 +98,6 @@ $CLI volume statedump $V0 all EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $N0 TEST $CLI volume stop $V0 -EXPECT "1" get_aux rm -f $QDD diff --git a/tests/basic/quota-nfs.t b/tests/basic/quota-nfs.t index 74fde400bd1..663a8da90ad 100755 --- a/tests/basic/quota-nfs.t +++ b/tests/basic/quota-nfs.t @@ -58,7 +58,6 @@ TEST rm -f $N0/$deep/newfile_2 EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" umount_nfs $N0 TEST $CLI volume stop $V0 -EXPECT "1" get_aux rm -f $QDD cleanup; diff --git a/tests/basic/quota.t b/tests/basic/quota.t index 17d571060e1..7f8b21de6f8 100755 --- a/tests/basic/quota.t +++ b/tests/basic/quota.t @@ -40,12 +40,8 @@ EXPECT 'on' volinfo_field $V0 'features.quota' EXPECT 'on' volinfo_field $V0 'features.inode-quota' EXPECT 'on' volinfo_field $V0 'features.quota-deem-statfs' -#Wait for the auxiliarymount to come up -sleep 3 TEST $CLI volume quota $V0 limit-usage /test_dir 100MB -# Checking for auxiliary mount -EXPECT "0" get_aux TEST $CLI volume quota $V0 limit-usage /test_dir/in_test_dir 150MB @@ -231,9 +227,7 @@ EXPECT 'off' volinfo_field $V0 'features.quota' EXPECT 'off' volinfo_field $V0 'features.inode-quota' EXPECT '' volinfo_field $V0 'features.quota-deem-statfs' -# aux mount should be removed TEST $CLI volume stop $V0; -EXPECT "1" get_aux rm -f $QDD cleanup; diff --git a/tests/basic/quota_aux_mount.t b/tests/basic/quota_aux_mount.t new file mode 100755 index 00000000000..78d7f47e373 --- /dev/null +++ b/tests/basic/quota_aux_mount.t @@ -0,0 +1,53 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +cleanup; + +##------------------------------------------------------------- +## Tests to verify that aux mount is unmounted after each quota +## command executes. +##------------------------------------------------------------- + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume info; + +TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2,3,4}; + +EXPECT "$V0" volinfo_field $V0 'Volume Name'; +EXPECT 'Created' volinfo_field $V0 'Status'; +EXPECT '4' brick_count $V0 + +TEST $CLI volume start $V0; +EXPECT 'Started' volinfo_field $V0 'Status'; + +TEST $GFS -s $H0 --volfile-id $V0 $M0; + +TEST mkdir -p $M0/test_dir/ + +TEST $CLI volume quota $V0 enable +EXPECT 'on' volinfo_field $V0 'features.quota' +EXPECT 'on' volinfo_field $V0 'features.inode-quota' + +TEST $CLI volume quota $V0 limit-usage /test_dir 150MB +EXPECT "1" get_limit_aux +TEST $CLI volume quota $V0 limit-objects /test_dir 10 +EXPECT "1" get_limit_aux +EXPECT "150.0MB" quota_hard_limit "/test_dir"; +EXPECT "1" get_list_aux +EXPECT "10" quota_object_hard_limit "/test_dir"; +EXPECT "1" get_list_aux + +TEST $CLI volume quota $V0 remove /test_dir/ +EXPECT "1" get_limit_aux +TEST $CLI volume quota $V0 remove-objects /test_dir +EXPECT "1" get_limit_aux + +TEST $CLI volume quota $V0 disable + +TEST $CLI volume stop $V0; + +cleanup; +#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=1447344 -- cgit