diff options
| author | Richard Wareing <rwareing@fb.com> | 2015-09-25 19:35:10 -0700 |
|---|---|---|
| committer | Jeff Darcy <jdarcy@fb.com> | 2017-07-03 07:49:23 -0700 |
| commit | 1d5d6ec423a21d698196cca39c7ba0e2563d9ba8 (patch) | |
| tree | f2bf6f58789a96c23cc7ee93e7442ccf2623798e | |
| parent | 992a9f8494a358f828eeef34b46e9f5ccfca1d3b (diff) | |
cluster/afr: Adjust gfid unsplit flow for proper correctness w/ AFR2
Summary:
- Prior patch did not re-run the gfid-mismatch flow after doing the
unsplit. I think this is prudent to re-validate the unsplit worked as
well as allow the code to continue from where it effectively left off.
Test Plan: - Run prove -v tests/basic/gfid_unsplit.t
Reviewers: dph, moox, sshreyas
Reviewed By: sshreyas
Differential Revision: https://phabricator.fb.com/D2483295
Signature: t1:2483295:1443237512:84baa105ddabaabdac52628121a44a98fb55ffa5
Blame Revision: Change-Id: I7b8a327be7272dd561fbf2995d781923b316ec45
Change-Id: Ib3ed40f3db38c89090a876d7af3a1b2a303539d5
| -rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-name.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-name.c b/xlators/cluster/afr/src/afr-self-heal-name.c index b28ce4170f1..76c301371c0 100644 --- a/xlators/cluster/afr/src/afr-self-heal-name.c +++ b/xlators/cluster/afr/src/afr-self-heal-name.c @@ -408,6 +408,7 @@ __afr_selfheal_name_do (call_frame_t *frame, xlator_t *this, inode_t *parent, gf_boolean_t source_is_empty = _gf_true; gf_boolean_t need_heal = _gf_false; gf_boolean_t is_gfid_absent = _gf_false; + gf_boolean_t tried_gfid_unsplit = _gf_false; need_heal = afr_selfheal_name_need_heal_check (this, replies); if (!need_heal) @@ -429,20 +430,33 @@ __afr_selfheal_name_do (call_frame_t *frame, xlator_t *this, inode_t *parent, if (ret) return ret; +gfid_mismatch_check: ret = afr_selfheal_name_gfid_mismatch_check (this, replies, source, sources, &gfid_idx, pargfid, bname); - if (ret) + + if (ret && tried_gfid_unsplit == _gf_true) return ret; - if (gfid_idx == -1) { - if (!gfid_req || gf_uuid_is_null (gfid_req)) + if (gfid_idx == -1) { + if (!gfid_req || uuid_is_null (gfid_req)) return -1; gfid = gfid_req; } else { gfid = &replies[gfid_idx].poststat.ia_gfid; } + if (ret && tried_gfid_unsplit == _gf_false) { + ret = __afr_selfheal_gfid_unsplit (this, parent, pargfid, + bname, inode, replies, gfid, locked_on); + + if (ret) + return ret; + + tried_gfid_unsplit = _gf_true; + goto gfid_mismatch_check; + } + is_gfid_absent = (gfid_idx == -1) ? _gf_true : _gf_false; ret = __afr_selfheal_assign_gfid (this, parent, pargfid, bname, inode, replies, gfid, locked_on, |
