summaryrefslogtreecommitdiffstats
path: root/tests/include.rc
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2014-05-23 12:51:28 +0530
committerAnand Avati <avati@redhat.com>2014-06-12 01:10:45 -0700
commitd240958fb36e652a2b910fe79414fb8b934e6158 (patch)
tree99f5357a7aa527db304ce0487fade3905de0d4c1 /tests/include.rc
parentafeaab53f6ca450a3147a6230906a83ee1bebe5a (diff)
storage/posix: Janitor should guard against dir renames.
Problem: Directory rename while a brick is down can cause gfid handle of that directory to be deleted until next lookup happens on that directory. *) Self-heal does not have intelligence to detect renames at the moment. So it has to delete the directory 'd' using special flags, because it has to perform 'rm -rf' of that directory as it is not empty. Posix xlator implements this by renaming the directory deleted to 'landfill' directory in '.glusterfs' where janitor thread will perform actual rm -rf by traversing the directory. Janitor thread wakes up every 10 minutes to check if there are any directories to be deleted and deletes them. As part of deleting it also deletes the gfid-handles. Steps to hit the problem: 1) On a replicate volume create a directory 'd', file in 'd' called 'f' so the directory 'd' is not empty. 2) bring one of the bricks down (lets call it brick-a, the other one is brick-b 3) Rename d to d1 4) When brick-a comes online again, self-heal deletes directory 'd' and creates directory 'd1' on brick-a for performing self-heal. So on brick-a, gfid-handle of 'd' pointing to 'da is deleted and recreated to point to 'd1'. 5) This directory 'b' with all its directory hierarchy (for now just the file 'f') will be under 'landfill' directory. 6) When janitor thread wakes up and deletes directory 'd' and gfid-handle of 'd' without realizing that it is now pointing to 'd1'. Thus 'd1' loses its gfid-handle Fix: Delete gfid-handle for a directory only when the gfid-handle is stale. Change-Id: I21265b3bd3852f0967d916aaa21108ae5c9e7373 BUG: 1101143 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/7879 Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'tests/include.rc')
-rw-r--r--tests/include.rc1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/include.rc b/tests/include.rc
index 882785bd1b3..5dbbc7c7336 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -16,6 +16,7 @@ REBALANCE_TIMEOUT=120
REOPEN_TIMEOUT=20
HEAL_TIMEOUT=60
MARKER_UPDATE_TIMEOUT=20
+JANITOR_TIMEOUT=60
statedumpdir=`gluster --print-statedumpdir`; # Default directory for statedump