diff options
author | Xavier Hernandez <jahernan@redhat.com> | 2017-11-22 11:10:32 +0100 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2017-11-28 09:11:45 +0000 |
commit | c471636264040d84e0f21f5a26f61746aa65975a (patch) | |
tree | 66649538dc7ecf1c7a5791a483a95974bcbd186b /xlators/cluster/ec/src/ec-data.c | |
parent | eba88aed7d2813bfccd1455d4148c4f25d9d0e48 (diff) |
cluster/ec: Prevent self-heal to work after PARENT_DOWN
When the volume is being stopped, PARENT_DOWN event is received.
This instructs EC to wait until all pending operations are completed
before declaring itself down. However heal operations are ignored
and allowed to continue even after having said it was down.
This may cause unexpected results and crashes.
To solve this, heal operations are considered exactly equal as any
other operation and EC won't propagate PARENT_DOWN until all
operations, including healing, are complete. To avoid big delays
if this happens in the middle of a big heal, a check has been
added to quit current heal if shutdown is detected.
Change-Id: I26645e236ebd115eb22c7ad4972461111a2d2034
BUG: 1515266
Signed-off-by: Xavier Hernandez <jahernan@redhat.com>
Diffstat (limited to 'xlators/cluster/ec/src/ec-data.c')
-rw-r--r-- | xlators/cluster/ec/src/ec-data.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/xlators/cluster/ec/src/ec-data.c b/xlators/cluster/ec/src/ec-data.c index 9d64280eb35..a869735794e 100644 --- a/xlators/cluster/ec/src/ec-data.c +++ b/xlators/cluster/ec/src/ec-data.c @@ -104,19 +104,6 @@ void ec_cbk_data_destroy(ec_cbk_data_t * cbk) mem_put(cbk); } -/* PARENT_DOWN will be notified to children only after these fops are complete - * when graph switch happens. We do not want graph switch to be waiting on - * heal to complete as healing big file/directory could take a while. Which - * will lead to hang on the mount. - */ -static gf_boolean_t -ec_needs_graceful_completion (ec_fop_data_t *fop) -{ - if ((fop->id != EC_FOP_HEAL) && (fop->id != EC_FOP_FHEAL)) - return _gf_true; - return _gf_false; -} - ec_fop_data_t * ec_fop_data_allocate(call_frame_t * frame, xlator_t * this, int32_t id, uint32_t flags, uintptr_t target, int32_t minimum, @@ -203,13 +190,11 @@ ec_fop_data_t * ec_fop_data_allocate(call_frame_t * frame, xlator_t * this, fop->parent = parent; } - if (ec_needs_graceful_completion (fop)) { - LOCK(&ec->lock); + LOCK(&ec->lock); - list_add_tail(&fop->pending_list, &ec->pending_fops); + list_add_tail(&fop->pending_list, &ec->pending_fops); - UNLOCK(&ec->lock); - } + UNLOCK(&ec->lock); return fop; } |