diff options
author | Ravishankar N <ravishankar@redhat.com> | 2013-12-23 09:32:22 +0000 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-12-24 02:24:20 -0800 |
commit | f9698036fcc1ceedea19110139400d0cf4a54c9a (patch) | |
tree | 30d86c2a7f8af8aa48d00009bd56529a969eeec5 /tests | |
parent | 879be836145f1d0b4bc381e7416ca8bd0811b718 (diff) |
cluster/afr: avoid race due to afr_is_transaction_running()
Problem:
------------------------------------------
afr_lookup_perform_self_heal() {
if(afr_is_transaction_running())
goto out
else
afr_launch_self_heal();
}
------------------------------------------
When 2 clients simultaneously access a file in split-brain, one of them
acquires the inode lock and proceeds with afr_launch_self_heal (which
eventually fails and sets "sh-failed" in the callback.)
The second client meanwhile bails out of afr_lookup_perform_self_heal()
because afr_is_transaction_running() returns true due to the lock obtained by
client-1. Consequetly in client-2, "sh-failed" does not get set in the dict,
causing quick-read translator to *not* invalidate the inode, thereby serving
data randomly from one of the bricks.
Fix:
If a possible split-brain is detected on lookup, forcefully traverse the
afr_launch_self_heal() code path in afr_lookup_perform_self_heal().
Change-Id: I316f9f282543533fd3c958e4b63ecada42c2a14f
BUG: 870565
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/6578
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Varun Shastry <vshastry@redhat.com>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions