summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVijaykumar M <vmallika@redhat.com>2013-12-13 14:18:16 +0530
committerAnand Avati <avati@redhat.com>2014-02-02 23:10:38 -0800
commit3023a50c1410b4da457e86bed69c320760d37344 (patch)
tree7d8f1a89e1150155f7c840d56f9f160e4ad207e3 /tests
parent922134fdc08afb2810cb0205f26693d36db6fd4e (diff)
dht: do not remove linkfile if file exist in cached sub volume
Currently with rmdir, if a directory contains only the linkfiles we remove all the linkfiles and this is causing the problem when the cached sub volume is down and end-up with duplicate files showing on the mount point. Solution: Before removing a linkfile check if the files exists in cached subvolume. Change-Id: Iedffd0d9298ec8bb95d5ce27c341c9ade81f0d3c BUG: 1042725 Signed-off-by: Vijaykumar M <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/6500 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/bug-1042725.t49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/bugs/bug-1042725.t b/tests/bugs/bug-1042725.t
new file mode 100644
index 00000000000..f3154e06dbf
--- /dev/null
+++ b/tests/bugs/bug-1042725.t
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+
+cleanup;
+
+#Basic checks
+TEST glusterd
+TEST pidof glusterd
+TEST $CLI volume info
+
+#Create a distributed volume
+TEST $CLI volume create $V0 $H0:$B0/${V0}{1..2};
+TEST $CLI volume start $V0
+
+# Mount FUSE
+TEST glusterfs -s $H0 --volfile-id $V0 $M0
+
+#Create files
+TEST mkdir $M0/foo
+TEST touch $M0/foo/{1..20}
+for file in {1..20}; do
+ ln $M0/foo/$file $M0/foo/${file}_linkfile;
+done
+
+#Stop one of the brick
+TEST kill_brick ${V0} ${H0} ${B0}/${V0}1
+
+rm -rf $M0/foo 2>/dev/null
+TEST stat $M0/foo
+
+touch $M0/foo/{1..20} 2>/dev/null
+touch $M0/foo/{1..20}_linkfile 2>/dev/null
+
+TEST $CLI volume start $V0 force;
+sleep 5
+function verify_duplicate {
+ count=`ls $M0/foo | sort | uniq --repeated | grep [0-9] -c`
+ echo $count
+}
+EXPECT 0 verify_duplicate
+
+TEST umount $M0
+TEST $CLI volume stop $V0
+TEST $CLI volume delete $V0;
+TEST ! $CLI volume info $V0;
+
+cleanup;