summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorXavier Hernandez <xhernandez@datalab.es>2015-01-07 12:29:48 +0100
committerRaghavendra Bhat <raghavendra@redhat.com>2015-02-11 01:20:24 -0800
commit1c14d8268b36e401ad7ac74ba3f082100fbe2bcc (patch)
tree3f1e87c4156fdc7e2a674eecaa644c0c955f7b8d /tests
parent6c5007d944bc7feddb19d5245f134c5602940d7b (diff)
ec: Fix failures with missing files
When a file does not exist on a brick but it does on others, there could be problems trying to access it because there was some loc_t structures with null 'pargfid' but 'name' was set. This forced inode resolution based on <pargfid>/name instead of <gfid> which would be the correct one. To solve this problem, 'name' is always set to NULL when 'pargfid' is not present. Another problem was caused by an incorrect management of errors while doing incremental locking. The only allowed error during an incremental locking was ENOTCONN, but missing files on a brick can be returned as ESTALE. This caused an EIO on the operation. This patch doesn't care of errors during an incremental locking. At the end of the operation it will check if there are enough successfully locked bricks to continue or not. This is a backport of http://review.gluster.org/9407/ Change-Id: I9360ebf8d819d219cea2d173c09bd37679a6f15a BUG: 1183716 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9560 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/bugs/bug-1176062.t35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/bugs/bug-1176062.t b/tests/bugs/bug-1176062.t
new file mode 100755
index 00000000000..4a9d0d95e76
--- /dev/null
+++ b/tests/bugs/bug-1176062.t
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+
+cleanup
+
+trap "jobs -p | xargs -r kill -9" EXIT INT QUIT
+
+TEST glusterd
+TEST pidof glusterd
+TEST $CLI volume create $V0 disperse 3 redundancy 1 $H0:$B0/${V0}{0..2}
+TEST $CLI volume set $V0 diagnostics.client-log-level TRACE
+EXPECT 'Created' volinfo_field $V0 'Status'
+TEST $CLI volume start $V0
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Started' volinfo_field $V0 'Status'
+TEST glusterfs --attribute-timeout=0 --entry-timeout=0 --volfile-id=/$V0 --volfile-server=$H0 $M0
+EXPECT_WITHIN $CHILD_UP_TIMEOUT "3" ec_child_up_count $V0 0
+
+TEST mkdir -p $M0/a/b/c
+dd if=/dev/zero of=$M0/a/b/c/test bs=1024k &
+
+sleep 1
+
+TEST gluster volume replace-brick $V0 $H0:$B0/${V0}0 $H0:$B0/${V0}3 commit force
+
+sleep 10
+
+TEST kill -TERM %1
+wait %1
+# Verify that the 'dd' process was terminated by the 'kill -TERM' and not by
+# any other error.
+TEST [ $? -eq 143 ]
+
+cleanup