summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-selfheal.c
diff options
context:
space:
mode:
authorSusant Palai <spalai@redhat.com>2015-06-16 20:35:46 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-08-26 21:55:56 -0700
commit6aa0e72198e83d6dd849027fd3d0038037810065 (patch)
treef3bda5926513cf53b1741a6c2c4d2843ebb881e6 /xlators/cluster/dht/src/dht-selfheal.c
parent6c4096f5e6a6d0f2b21cb4b2bea098b6f4eebbed (diff)
dht: block/handle create op falling to decommissioned brick
Problem: Post remove-brick start till commit phase, the client layout may not be in sync with disk layout because of lack of lookup. Hence,a create call may fall on the decommissioned brick. Solution: Will acquire a lock on hashed subvol. So that a fix-layout or selfheal can not step on layout while reading the layout. Even if we read a layout before remove-brick fix-layout and the file falls on the decommissioned brick, the file should be migrated to a new brick as per the fix-layout. BUG: 1256283 Change-Id: I3ef1adaf20dfb9524396a3648d1a664464eda8c1 Signed-off-by: Susant Palai <spalai@redhat.com> Reviewed-on: http://review.gluster.org/11260 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Signed-off-by: Susant Palai <spalai@redhat.com> Reviewed-on: http://review.gluster.org/12001
Diffstat (limited to 'xlators/cluster/dht/src/dht-selfheal.c')
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index cfe7e5a63ce..cd1d97f7fc0 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -214,7 +214,7 @@ unlock:
if (is_last_call (this_call_cnt)) {
if (local->op_ret == 0) {
- dht_refresh_layout_done (frame);
+ local->refresh_layout_done (frame);
} else {
goto err;
}
@@ -224,7 +224,8 @@ unlock:
return 0;
err:
- dht_selfheal_dir_finish (frame, this, -1);
+ local->refresh_layout_unlock (frame, this, -1);
+
return 0;
}
@@ -290,7 +291,7 @@ dht_refresh_layout (call_frame_t *frame)
return 0;
out:
- dht_selfheal_dir_finish (frame, this, -1);
+ local->refresh_layout_unlock (frame, this, -1);
return 0;
}
@@ -299,10 +300,21 @@ int32_t
dht_selfheal_layout_lock_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, dict_t *xdata)
{
+ dht_local_t *local = NULL;
+
+ local = frame->local;
+
+ if (!local) {
+ goto err;
+ }
+
if (op_ret < 0) {
goto err;
}
+ local->refresh_layout_unlock = dht_selfheal_dir_finish;
+ local->refresh_layout_done = dht_refresh_layout_done;
+
dht_refresh_layout (frame);
return 0;