From c8be9af5f54aa3e42dffee4024d2915743258242 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Thu, 5 Mar 2015 11:29:25 +0000 Subject: afr: remove stale index entries Problem: During pre-op phase, the index xlator 1. Creates the entry inside .glusterfs/indices/xattrop 2. Winds the xattrop fop to posix to mark dirty/pending changelogs. If the brick crashes after 1, the xattrop entry becomes stale and never gets removed by shd during subsequent crawls because there is nothing to heal (changelogs are zero). Though the stale entry does not get displayed in the output of 'heal info' command, it nevertheless stays there forever unless a new write transaction is performed on the file. Fix: During index self-heal if afr xattrs are found to be clean (indicated by ret value of 2 on a call to afr_shd_selfheal(), send a dummy post-op with all 0s for the xattr values, which makes the index xlator to unlink the stale entry. Change-Id: I02cb2bc937f2e3f3f3cb35d67b006664dc7ef919 BUG: 1190069 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/9714 Tested-by: Gluster Build System Reviewed-by: Anuradha Talur Reviewed-by: Pranith Kumar Karampuri Tested-by: Pranith Kumar Karampuri --- tests/bugs/replicate/bug-1101647.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/bugs/replicate/bug-1101647.t') diff --git a/tests/bugs/replicate/bug-1101647.t b/tests/bugs/replicate/bug-1101647.t index 148af987f20..14e98c88c6b 100644 --- a/tests/bugs/replicate/bug-1101647.t +++ b/tests/bugs/replicate/bug-1101647.t @@ -13,13 +13,13 @@ TEST $CLI volume start $V0; TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0 EXPECT_WITHIN 20 "Y" glustershd_up_status -#Create base entry in indices/xattrop and indices/base_indices_holder +#Create base entry in indices/xattrop echo "Data">$M0/file TEST $CLI volume heal $V0 -#Entries from indices/xattrop and indices/base_indices_holder should not be cleared after a heal. -EXPECT 1 count_sh_entries $B0/$V0"1" -EXPECT 1 count_sh_entries $B0/$V0"2" +#Entries from indices/xattrop should not be cleared after a heal. +EXPECT 1 count_index_entries $B0/$V0"1" +EXPECT 1 count_index_entries $B0/$V0"2" TEST kill_brick $V0 $H0 $B0/${V0}2 echo "More data">>$M0/file -- cgit