From ff86417be4046575e0eb648fb3a47274aaf18ecd Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Fri, 11 Aug 2017 15:43:58 +0530 Subject: cluster/afr: Make choose-local "reconfigurable" Backport of: > Change-Id: Ibab292ba705d993b475cd0303fb3318211fb2500 > Reviewed-on: https://review.gluster.org/18026 > BUG: 1480525 > cherry-picked from commit 1e2d6537875d16b783e3c50ada7ee61487c6d796 With this change, enabling choose-local (which means its state makes transition from "off" to "on") will be effective after the first gfid-lookup on "/" since volume-set was executed. Change-Id: Ibab292ba705d993b475cd0303fb3318211fb2500 BUG: 1501022 Signed-off-by: Krutika Dhananjay --- xlators/cluster/afr/src/afr.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'xlators') diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 14805c2c007..84dbcc04680 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -135,6 +135,7 @@ reconfigure (xlator_t *this, dict_t *options) char *qtype = NULL; char *fav_child_policy = NULL; gf_boolean_t consistent_io = _gf_false; + gf_boolean_t choose_local_old = _gf_false; priv = this->private; @@ -202,6 +203,16 @@ reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("read-subvolume", read_subvol, options, xlator, out); + choose_local_old = priv->choose_local; + GF_OPTION_RECONF ("choose-local", priv->choose_local, options, bool, + out); + + if (choose_local_old != priv->choose_local) { + priv->read_child = -1; + if (choose_local_old == _gf_false) + priv->did_discovery = _gf_false; + } + GF_OPTION_RECONF ("read-hash-mode", priv->hash_mode, options, uint32, out); -- cgit