From 8e2eaa6ea495e151adf1eca9cdd17f0a9f1a1bfc Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Mon, 26 Dec 2016 21:08:03 +0530 Subject: cluster/afr: Fix missing name indices due to EEXIST error Backport of: http://review.gluster.org/16286 PROBLEM: Consider a volume with granular-entry-heal and sharding enabled. When a replica is down and a shard is created as part of a write, the name index is correctly created under indices/entry-changes/. Now when a read on the same region triggers another MKNOD, the fop fails on the online bricks with EEXIST. By virtue of this being a symmetric error, the failed_subvols[] array is reset to all zeroes. Because of this, before post-op, the GF_XATTROP_ENTRY_OUT_KEY will be set, causing the name index, which was created in the previous MKNOD operation, to be wrongly deleted in THIS MKNOD operation. FIX: The ideal fix would have been for a transaction to delete the name index ONLY if it knows it is the one that created the index in the first place. This would involve gathering information as to whether THIS xattrop created the index from individual bricks, aggregating their responses and based on the various posisble combinations of responses, decide whether to delete the index or not. This is rather complex. Simpler fix would be for post-op to examine local->op_ret in the event of no failed_subvols to figure out whether to delete the name index or not. This can occasionally lead to creation of stale name indices but they won't be affecting the IO path or mess with pending changelogs in any way and self-heal in its crawl of "entry-changes" directory would take care to delete such indices. Change-Id: Icc642a987d1b6a5097562315aecf1263ed35ceb6 BUG: 1408786 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/16293 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- tests/include.rc | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/include.rc') diff --git a/tests/include.rc b/tests/include.rc index 0c5d2989106..f7a388689dc 100644 --- a/tests/include.rc +++ b/tests/include.rc @@ -11,6 +11,7 @@ B0=${B0:=/d/backends}; # top level of brick directories WORKDIRS="$B0 $M0 $M1 $M2 $N0 $N1" ROOT_GFID="00000000-0000-0000-0000-000000000001" +DOT_SHARD_GFID="be318638-e8a0-4c6d-977d-7a937aa84806" META_VOL=${META_VOL:=gluster_shared_storage}; # shared gluster storage volume used by snapshot scheduler, nfs ganesha and geo-rep. META_MNT=${META_MNT:=/var/run/gluster/shared_storage}; # Mount point of shared gluster volume. -- cgit From cb8bc3396d16e777d9a2683886fefd43e747e8a3 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Thu, 29 Dec 2016 12:10:00 +0000 Subject: tests: Fix split-brain-favorite-child-policy.t failures Problem: In CentOS-7, the file was receving an extra removexattr(security.ima) FOP which changed its ctime, breaking the assumption that a particular brick had the latest ctime based on the writevs done in the .t Fix: 1. Compare the ctime of both files in the backend and pick the one with the latest ctime for the fav-child policy. Also unmount the volume before comparing, to avoid any further FOPS on the file that can possibly modify the timestamps. 2. Added floating point handling in stat function. Thanks to Pranith for the helping debugging the regex. > Reviewed-on: http://review.gluster.org/16288 > Smoke: Gluster Build System > NetBSD-regression: NetBSD Build System > CentOS-regression: Gluster Build System > Reviewed-by: Pranith Kumar Karampuri (cherry picked from commit 76fff8cb2a164b596ca67e65c99623f5b68361fd) Change-Id: I06041a0f39a29d2593b867af8685d65c7cd99150 BUG: 1410073 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/16324 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- tests/include.rc | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/include.rc') diff --git a/tests/include.rc b/tests/include.rc index f7a388689dc..492e35a7b6c 100644 --- a/tests/include.rc +++ b/tests/include.rc @@ -407,6 +407,7 @@ stat -c %s /dev/null > /dev/null 2>&1 || { *%Y*) cmd="${cmd} s/%Y/`$( which stat ) -f %m $f`/g;" ;& *%X*) cmd="${cmd} s/%X/`$( which stat ) -f %a $f`/g;" ;& *%Z*) cmd="${cmd} s/%Z/`$( which stat ) -f %c $f`/g;" ;& + *%.Z*) cmd="${cmd} s/%.Z/`$( which stat ) -f %.9Fc $f`/g;" ;& *%b*) cmd="${cmd} s/%b/`$( which stat ) -f %b $f`/g;" ;& *%B*) cmd="${cmd} s/%B/512/g;" ;& *%t*) cmd="${cmd} s/%t/`$( which stat ) -f %XHr $f`/g;" ;& -- cgit