From b58a15948fb3fc37b6c0b70171482f50ed957f42 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Thu, 15 Jun 2017 15:36:07 +0530 Subject: index: Do not proceed with init if brick is not mounted ..or else when a volume start force is given, we end up creating /brick-path/.glusterfs/indices folder and various subdirs under it and eventually starting the brick process. As a part of this patch, glusterd_get_index_basepath() is added in glusterd, who will then use it to create the basepath during volume-create, add-brick, replace-brick and reset-brick. It also uses this function to set the 'index-base' xlator option for the index translator. Change-Id: Id018cf3cb6f1e2e35b5c4cf438d1e939025cb0fc BUG: 1457202 Signed-off-by: Ravishankar N Reviewed-on: https://review.gluster.org/17426 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee Reviewed-by: Pranith Kumar Karampuri --- tests/basic/afr/resolve.t | 5 +++++ tests/bugs/replicate/bug-1130892.t | 5 +++++ tests/bugs/replicate/bug-1402730.t | 6 ++++++ tests/bugs/replicate/bug-830665.t | 5 +++++ 4 files changed, 21 insertions(+) (limited to 'tests') diff --git a/tests/basic/afr/resolve.t b/tests/basic/afr/resolve.t index 2d400563c2e..f7351f843ba 100644 --- a/tests/basic/afr/resolve.t +++ b/tests/basic/afr/resolve.t @@ -23,6 +23,11 @@ echo abc > g TEST kill_brick $V0 $H0 $B0/${V0}0 rm -rf $B0/${V0}0/.glusterfs $B0/${V0}0/a +#Ideally, disk replacement is done using reset-brick or replace-brick gluster CLI +#which will create .glusterfs/indices folder. +mkdir $B0/${V0}0/.glusterfs && chmod 600 $B0/${V0}0/.glusterfs +mkdir $B0/${V0}0/.glusterfs/indices && chmod 600 $B0/${V0}0/.glusterfs/indices + TEST $CLI volume start $V0 force EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_meta $M0 $V0-replicate-0 0 #Test that the lookup returns ENOENT instead of ESTALE diff --git a/tests/bugs/replicate/bug-1130892.t b/tests/bugs/replicate/bug-1130892.t index 7442ab80f0f..9005791a597 100644 --- a/tests/bugs/replicate/bug-1130892.t +++ b/tests/bugs/replicate/bug-1130892.t @@ -39,6 +39,11 @@ TEST kill_brick $V0 $H0 $B0/${V0}-1 TEST rm -rf $B0/${V0}-1/one TEST rm -rf $B0/${V0}-1/.glusterfs +#Ideally, disk replacement is done using reset-brick or replace-brick gluster CLI +#which will create .glusterfs/indices folder. +mkdir $B0/${V0}-1/.glusterfs && chmod 600 $B0/${V0}-1/.glusterfs +mkdir $B0/${V0}-1/.glusterfs/indices && chmod 600 $B0/${V0}-1/.glusterfs/indices + # Start force TEST $CLI volume start $V0 force diff --git a/tests/bugs/replicate/bug-1402730.t b/tests/bugs/replicate/bug-1402730.t index dcde60dbdf7..28c6761f91f 100644 --- a/tests/bugs/replicate/bug-1402730.t +++ b/tests/bugs/replicate/bug-1402730.t @@ -22,6 +22,12 @@ cd $M0/a/b/c TEST kill_brick $V0 $H0 $B0/${V0}2 rm -rf $B0/${V0}2/* rm -rf $B0/${V0}2/.glusterfs + +#Ideally, disk replacement is done using reset-brick or replace-brick gluster CLI +#which will create .glusterfs/indices folder. +mkdir $B0/${V0}2/.glusterfs && chmod 600 $B0/${V0}2/.glusterfs +mkdir $B0/${V0}2/.glusterfs/indices && chmod 600 $B0/${V0}2/.glusterfs/indices + TEST $CLI volume start $V0 force EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" afr_child_up_status $V0 0 diff --git a/tests/bugs/replicate/bug-830665.t b/tests/bugs/replicate/bug-830665.t index c748c1304bf..d044dae75ea 100755 --- a/tests/bugs/replicate/bug-830665.t +++ b/tests/bugs/replicate/bug-830665.t @@ -76,6 +76,11 @@ volid=$(getfattr -e hex -n trusted.glusterfs.volume-id $B0/${V0}-0 2> /dev/null | grep = | cut -d= -f2) rm -rf $B0/${V0}-0; mkdir $B0/${V0}-0; +#Ideally, disk replacement is done using reset-brick or replace-brick gluster CLI +#which will create .glusterfs/indices folder. +mkdir $B0/${V0}-0/.glusterfs && chmod 600 $B0/${V0}-0/.glusterfs +mkdir $B0/${V0}-0/.glusterfs/indices && chmod 600 $B0/${V0}-0/.glusterfs/indices + setfattr -n trusted.glusterfs.volume-id -v $volid $B0/${V0}-0 ## Restart and remount. Note that we use actimeo=0 so that the stat calls -- cgit