From bb438d849a4a3941c1a9b525213f695f0a2c961b Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Thu, 27 Oct 2016 07:30:48 +0200 Subject: feature/dht: undo partially successful dir rename As with dht, dirs are present on all subvolumes, renaming them is a compound operation and thus a partial success + partial failure scenario is possible, resulting in an inconsistent state. For purposes of reproduction, such a scenario can easily be produced by stopping the volume, edit the volfile of a certain subvolume to get at an "option read-only on" setting, and then restart the volume. Thus those operations that are to make change on the affected subvolume will fail with EROFS. To handle such scenarios, we introduce an in-memory cache where we record the return values obtained from the subvolumes. At the final stage of the dir rename operation we check if it's a partial success/fail situation. If yes, then we perform a reverse rename op on those subvolumes where the operation succeeded. Change-Id: I3d05f74f53932cb984a918d252a7309c1009a51d BUG: 1412069 Signed-off-by: Raghavendra G Reviewed-on: http://review.gluster.org/15739 NetBSD-regression: NetBSD Build System Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: N Balachandran --- xlators/cluster/dht/src/dht-helper.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators/cluster/dht/src/dht-helper.c') diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index ad031b6216c..81d1dffa0af 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -638,6 +638,9 @@ dht_local_wipe (xlator_t *this, dht_local_t *local) local->stub = NULL; } + if (local->ret_cache) + GF_FREE (local->ret_cache); + mem_put (local); } -- cgit