From cd05e036117a27377af8ff4a1cdba09f1de0a8eb Mon Sep 17 00:00:00 2001 From: Anuradha Date: Thu, 11 Jun 2015 14:58:05 +0530 Subject: cluster/afr : set pending xattrs for replaced brick This patch is part two change to prevent data loss in a replicate volume on doing a replace-brick commit force operation. Problem: After doing replace-brick commit force, there is a chance that self heal might happen from the replaced (sink) brick rather than the source brick leading to data loss. Solution: Mark pending changelogs on afr children for the replaced afr-child so that heal is performed in the correct direction. Change-Id: Icb9807e49b4c1c4f1dcab115318d9a58ccf95675 BUG: 1207829 Signed-off-by: Anuradha Talur Reviewed-on: http://review.gluster.org/10448 Reviewed-by: Pranith Kumar Karampuri Tested-by: NetBSD Build System Reviewed-by: Krutika Dhananjay --- xlators/cluster/afr/src/afr-self-heal-common.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c') diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 9a9a852b4d7..1534531bf88 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -802,8 +802,8 @@ afr_selfheal_lock_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int -afr_selfheal_locked_fill (call_frame_t *frame, xlator_t *this, - unsigned char *locked_on) +afr_locked_fill (call_frame_t *frame, xlator_t *this, + unsigned char *locked_on) { int i = 0; afr_private_t *priv = NULL; @@ -846,7 +846,7 @@ afr_selfheal_tryinodelk (call_frame_t *frame, xlator_t *this, inode_t *inode, loc_wipe (&loc); - return afr_selfheal_locked_fill (frame, this, locked_on); + return afr_locked_fill (frame, this, locked_on); } @@ -877,7 +877,7 @@ afr_selfheal_inodelk (call_frame_t *frame, xlator_t *this, inode_t *inode, for (i = 0; i < priv->child_count; i++) { if (local->replies[i].op_ret == -1 && local->replies[i].op_errno == EAGAIN) { - afr_selfheal_locked_fill (frame, this, locked_on); + afr_locked_fill (frame, this, locked_on); afr_selfheal_uninodelk (frame, this, inode, dom, off, size, locked_on); @@ -889,7 +889,7 @@ afr_selfheal_inodelk (call_frame_t *frame, xlator_t *this, inode_t *inode, loc_wipe (&loc); - return afr_selfheal_locked_fill (frame, this, locked_on); + return afr_locked_fill (frame, this, locked_on); } @@ -932,7 +932,7 @@ afr_selfheal_tryentrylk (call_frame_t *frame, xlator_t *this, inode_t *inode, loc_wipe (&loc); - return afr_selfheal_locked_fill (frame, this, locked_on); + return afr_locked_fill (frame, this, locked_on); } @@ -957,7 +957,7 @@ afr_selfheal_entrylk (call_frame_t *frame, xlator_t *this, inode_t *inode, for (i = 0; i < priv->child_count; i++) { if (local->replies[i].op_ret == -1 && local->replies[i].op_errno == EAGAIN) { - afr_selfheal_locked_fill (frame, this, locked_on); + afr_locked_fill (frame, this, locked_on); afr_selfheal_unentrylk (frame, this, inode, dom, name, locked_on); @@ -969,7 +969,7 @@ afr_selfheal_entrylk (call_frame_t *frame, xlator_t *this, inode_t *inode, loc_wipe (&loc); - return afr_selfheal_locked_fill (frame, this, locked_on); + return afr_locked_fill (frame, this, locked_on); } -- cgit