summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-10-20 11:46:10 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-10-29 23:36:57 -0700
commitaf5e4e4ef75c845149aee4a8fefd50115157a6da (patch)
tree475c6c4660d04e4275cb91a6c6f74626932a2736 /tests
parent6bbce9b1a48d5d50a2044b4518270e952331f159 (diff)
features/shard: Force cache-refresh when lookup/readdirp/stat detect that xattr value has changed
Backport of: http://review.gluster.org/12400 Change-Id: Ifa51979bc530e31d36781759ca62bcac1de7af24 BUG: 1274600 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12457 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/shard/bug-1272986.t36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/bugs/shard/bug-1272986.t b/tests/bugs/shard/bug-1272986.t
new file mode 100644
index 00000000000..c041ce49482
--- /dev/null
+++ b/tests/bugs/shard/bug-1272986.t
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+. $(dirname $0)/../../include.rc
+
+cleanup
+
+TEST glusterd
+TEST pidof glusterd
+TEST $CLI volume create $V0 $H0:$B0/${V0}{0,1}
+TEST $CLI volume set $V0 features.shard on
+TEST $CLI volume set $V0 performance.strict-write-ordering on
+TEST $CLI volume start $V0
+
+# $M0 is where the reads will be done and $M1 is where files will be created,
+# written to, etc.
+TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0
+TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M1
+
+# Write some data into a file, such that its size crosses the shard block size.
+TEST dd if=/dev/zero of=$M1/file bs=1M count=5 conv=notrunc
+
+md5sum1_reader=$(md5sum $M0/file | awk '{print $1}')
+
+EXPECT "$md5sum1_reader" echo `md5sum $M1/file | awk '{print $1}'`
+
+# Append some more data into the file.
+TEST `echo "abcdefg" >> $M1/file`
+
+md5sum2_reader=$(md5sum $M0/file | awk '{print $1}')
+
+# Test to see if the reader refreshes its cache correctly as part of the reads
+# triggered through md5sum. If it does, then the md5sum on the reader and writer
+# must match.
+EXPECT "$md5sum2_reader" echo `md5sum $M1/file | awk '{print $1}'`
+
+cleanup