cf62f1947f
Resolves: bz#1264911 bz#1277924 bz#1286820 bz#1360331 bz#1401969 Resolves: bz#1410719 bz#1419438 bz#1426042 bz#1444820 bz#1459101 Resolves: bz#1464150 bz#1464350 bz#1466122 bz#1466129 bz#1467903 Resolves: bz#1468972 bz#1476876 bz#1484446 bz#1492591 bz#1498391 Resolves: bz#1498730 bz#1499865 bz#1500704 bz#1501345 bz#1505570 Resolves: bz#1507361 bz#1507394 bz#1509102 bz#1509191 bz#1509810 Resolves: bz#1509833 bz#1511766 bz#1512470 bz#1512496 bz#1512963 Resolves: bz#1515051 bz#1519076 bz#1519740 bz#1534253 bz#1534530 Signed-off-by: Milind Changire <mchangir@redhat.com>
77 lines
2.8 KiB
Diff
77 lines
2.8 KiB
Diff
From 1bcb5bbd42a4187ed385853f0364a3941bea9846 Mon Sep 17 00:00:00 2001
|
|
From: karthik-us <ksubrahm@redhat.com>
|
|
Date: Fri, 17 Nov 2017 17:29:36 +0530
|
|
Subject: [PATCH 078/128] cluster/afr: Honor default timeout of 5min for
|
|
analyzing split-brain files
|
|
|
|
Problem:
|
|
After setting split-brain-choice option to analyze the file to resolve
|
|
the split brain using the command
|
|
"setfattr -n replica.split-brain-choice -v "choiceX" <path-to-file>"
|
|
should allow to access the file from mount for default timeout of 5mins.
|
|
But the timeout was not honored and was able to access the file even after
|
|
the timeout.
|
|
|
|
Fix:
|
|
Call the inode_invalidate() in afr_set_split_brain_choice_cbk() so that
|
|
it will triger the cache invalidate after resetting the timer and the
|
|
split brain choice. So the next calls to access the file will fail with EIO.
|
|
|
|
Upstream patch: https://review.gluster.org/#/c/18546/
|
|
|
|
> Change-Id: I698cb833676b22ff3e4c6daf8b883a0958f51a64
|
|
> BUG: 1503519
|
|
> Signed-off-by: karthik-us <ksubrahm@redhat.com>
|
|
|
|
Change-Id: I698cb833676b22ff3e4c6daf8b883a0958f51a64
|
|
BUG: 1360331
|
|
Signed-off-by: karthik-us <ksubrahm@redhat.com>
|
|
Reviewed-on: https://code.engineering.redhat.com/gerrit/123560
|
|
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
---
|
|
xlators/cluster/afr/src/afr-common.c | 6 +++++-
|
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
|
|
index 2925a1d..9c96056 100644
|
|
--- a/xlators/cluster/afr/src/afr-common.c
|
|
+++ b/xlators/cluster/afr/src/afr-common.c
|
|
@@ -730,6 +730,7 @@ afr_set_split_brain_choice_cbk (void *data)
|
|
xlator_t *this = THIS;
|
|
|
|
afr_spb_choice_timeout_cancel (this, inode);
|
|
+ inode_invalidate (inode);
|
|
inode_unref (inode);
|
|
return;
|
|
}
|
|
@@ -749,6 +750,7 @@ afr_set_split_brain_choice (int ret, call_frame_t *frame, void *opaque)
|
|
gf_boolean_t timer_set = _gf_false;
|
|
gf_boolean_t timer_cancelled = _gf_false;
|
|
gf_boolean_t timer_reset = _gf_false;
|
|
+ gf_boolean_t need_invalidate = _gf_true;
|
|
int old_spb_choice = -1;
|
|
|
|
frame = data->frame;
|
|
@@ -861,6 +863,7 @@ set_timer:
|
|
timer_set = _gf_true;
|
|
if (timer_reset && !ctx->timer)
|
|
timer_cancelled = _gf_true;
|
|
+ need_invalidate = _gf_false;
|
|
}
|
|
unlock:
|
|
UNLOCK(&inode->lock);
|
|
@@ -873,7 +876,8 @@ unlock:
|
|
* reads from an older cached value despite a change in spb_choice to
|
|
* a new value.
|
|
*/
|
|
- inode_invalidate (inode);
|
|
+ if (need_invalidate)
|
|
+ inode_invalidate (inode);
|
|
out:
|
|
if (data)
|
|
GF_FREE (data);
|
|
--
|
|
1.8.3.1
|
|
|