diff options
| author | Pranith Kumar K <pkarampu@redhat.com> | 2016-03-17 19:42:00 +0530 |
|---|---|---|
| committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-04-16 22:46:21 -0700 |
| commit | 6b88d97c4a9e999180d77463e38ad14fc9d944cf (patch) | |
| tree | eba5134f30864dc9352770bbfc34e1577e250914 /xlators/cluster/afr/src/afr-self-heal-data.c | |
| parent | bd8ab0567017fd4dddfea738eae0bccc40b85527 (diff) | |
cluster/afr: Fix partial heals in 3-way replication
Problem:
When there are 2 sources and one sink and if two self-heal daemons
try to acquire locks at the same time, there is a chance that it
gets a lock on one source and sink leading partial to heal. This will
need one more heal from the remaining source to sink for the complete
self-heal. This is not optimal.
Fix:
Upgrade non-blocking locks to blocking lock on all the subvolumes, if
the number of locks acquired is majority and there were eagains.
>BUG: 1318751
>Change-Id: Iae10b8d3402756c4164b98cc49876056ff7a61e5
>Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
>Reviewed-on: http://review.gluster.org/13766
>Smoke: Gluster Build System <jenkins@build.gluster.com>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
>Reviewed-by: Ravishankar N <ravishankar@redhat.com>
>(cherry picked from commit 8deedef565df49def75083678f8d1558c7b1f7d3)
Change-Id: Ia164360dc1474a717f63633f5deb2c39cc15017c
BUG: 1327863
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/14008
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-data.c')
| -rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-data.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index 332471c87e6..67bb8e6d3c9 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -786,7 +786,7 @@ out: if (did_sh) afr_log_selfheal (fd->inode->gfid, this, ret, "data", source, - healed_sinks); + sources, healed_sinks); else ret = 1; @@ -844,8 +844,9 @@ afr_selfheal_data (call_frame_t *frame, xlator_t *this, inode_t *inode) locked_on = alloca0 (priv->child_count); - ret = afr_selfheal_tryinodelk (frame, this, inode, priv->sh_domain, 0, 0, - locked_on); + ret = afr_selfheal_tie_breaker_inodelk (frame, this, inode, + priv->sh_domain, 0, 0, + locked_on); { if (ret < AFR_SH_MIN_PARTICIPANTS) { gf_msg_debug (this->name, 0, "%s: Skipping " @@ -864,7 +865,8 @@ afr_selfheal_data (call_frame_t *frame, xlator_t *this, inode_t *inode) ret = __afr_selfheal_data (frame, this, fd, locked_on); } unlock: - afr_selfheal_uninodelk (frame, this, inode, priv->sh_domain, 0, 0, locked_on); + afr_selfheal_uninodelk (frame, this, inode, priv->sh_domain, 0, 0, + locked_on); if (fd) fd_unref (fd); |
