diff options
author | shishir gowda <sgowda@redhat.com> | 2012-11-27 12:05:28 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-11-29 02:26:18 -0800 |
commit | c85a3eee54b4028573c905829d5b46c0b6512c56 (patch) | |
tree | ae4c036be1c6cd7e8f223377accba74169e22c6f | |
parent | f8c19b4c6af34b96747881bcb85cddb87484f08e (diff) |
cluster/dht: send ACCESS call on dir to first_up_subvol if cached is downv3.4.0qa3
Change-Id: I4f518a969bbe3a11075e7c9ae10bd21bf059d5f3
BUG: 867253
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.org/4240
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r-- | tests/bugs/bug-867253.t | 55 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-inode-read.c | 11 |
2 files changed, 66 insertions, 0 deletions
diff --git a/tests/bugs/bug-867253.t b/tests/bugs/bug-867253.t new file mode 100644 index 000000000..c67366e4c --- /dev/null +++ b/tests/bugs/bug-867253.t @@ -0,0 +1,55 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc + +cleanup; + +function file_count() +{ + val=1 + + if [ "$1" == "0" ] + then + if [ "$2" == "0" ] + then + val=0 + fi + fi + echo $val +} + +BRICK_COUNT=2 + +TEST glusterd +TEST pidof glusterd + +TEST $CLI volume create $V0 $H0:$B0/${V0}0 $H0:$B0/${V0}1 +TEST $CLI volume start $V0 + +sleep 5; +## Mount nfs, with nocache option +TEST mount -o vers=3,nolock,noac -t nfs $H0:/$V0 $M0; + +touch $M0/files{1..1000}; + +# Kill a brick process +kill -9 `cat /var/lib/glusterd/vols/$V0/run/$H0-d-backends-${V0}0.pid`; + +echo 3 >/proc/sys/vm/drop_caches; + +ls -l $M0 >/dev/null; + +NEW_FILE_COUNT=`echo $?`; + +TEST $CLI volume start $V0 force + +# Kill a brick process +kill -9 `cat /var/lib/glusterd/vols/$V0/run/$H0-d-backends-${V0}1.pid`; + +echo 3 >/proc/sys/vm/drop_caches; + +ls -l $M0 >/dev/null; + +NEW_FILE_COUNT1=`echo $?`; + +EXPECT "0" file_count $NEW_FILE_COUNT $NEW_FILE_COUNT1 diff --git a/xlators/cluster/dht/src/dht-inode-read.c b/xlators/cluster/dht/src/dht-inode-read.c index 7e29a7a8c..f17cb73b9 100644 --- a/xlators/cluster/dht/src/dht-inode-read.c +++ b/xlators/cluster/dht/src/dht-inode-read.c @@ -498,12 +498,23 @@ dht_access_cbk (call_frame_t *frame, void *cookie, xlator_t *this, { int ret = -1; dht_local_t *local = NULL; + xlator_t *subvol = NULL; local = frame->local; if (local->call_cnt != 1) goto out; + if ((op_ret == -1) && (op_errno == ENOTCONN) && + IA_ISDIR(local->loc.inode->ia_type)) { + + subvol = dht_first_up_subvol (this); + if (!subvol) + goto out; + STACK_WIND (frame, dht_access_cbk, subvol, subvol->fops->access, + &local->loc, local->rebalance.flags, NULL); + return 0; + } if ((op_ret == -1) && (op_errno == ENOENT)) { /* File would be migrated to other node */ local->rebalance.target_op_fn = dht_access2; |