From 1c14d8268b36e401ad7ac74ba3f082100fbe2bcc Mon Sep 17 00:00:00 2001 From: Xavier Hernandez Date: Wed, 7 Jan 2015 12:29:48 +0100 Subject: 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 /name instead of 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 Reviewed-on: http://review.gluster.org/9560 Tested-by: Gluster Build System Reviewed-by: Dan Lambright Reviewed-by: Raghavendra Bhat --- tests/bugs/bug-1176062.t | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 tests/bugs/bug-1176062.t (limited to 'tests') 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 -- cgit