diff options
author | Gaurav Yadav <gyadav@redhat.com> | 2017-10-27 16:04:46 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2017-10-31 04:34:10 +0000 |
commit | 15fe99995b8650a677b097028bc14d61a5dd5e1b (patch) | |
tree | abbb5e45a5f9edc73af1cc68c7f998396c9c285e /xlators/mgmt/glusterd/src/glusterd-server-quorum.c | |
parent | 4edea128916eb76ec94fde90407eb70af6493337 (diff) |
glusterd: persist brickinfo's port change into glusterd's store
Problem:
Consider a case where node reboot is performed and prior to reboot
brick was listening to 49153. Post reboot glusterd assigned 49152
to brick and started the brick process but the new port was never
persisted. Now when glusterd restarts glusterd always read the port
from its persisted store i.e 49153 however pmap signin happens with
the correct port i.e 49152.
Fix:
Make sure when glusterd_brick_start is called, glusterd_store_volinfo is
eventually invoked.
Change-Id: Ic0efbd48c51d39729ed951a42922d0e59f7115a1
BUG: 1506589
Signed-off-by: Gaurav Yadav <gyadav@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-server-quorum.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-server-quorum.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-server-quorum.c b/xlators/mgmt/glusterd/src/glusterd-server-quorum.c index 468191cd27f..ae0243bad58 100644 --- a/xlators/mgmt/glusterd/src/glusterd-server-quorum.c +++ b/xlators/mgmt/glusterd/src/glusterd-server-quorum.c @@ -12,6 +12,7 @@ #include "glusterd-utils.h" #include "glusterd-messages.h" #include "glusterd-server-quorum.h" +#include "glusterd-store.h" #include "glusterd-syncop.h" #include "glusterd-op-sm.h" @@ -311,6 +312,7 @@ void glusterd_do_volume_quorum_action (xlator_t *this, glusterd_volinfo_t *volinfo, gf_boolean_t meets_quorum) { + int ret = -1; glusterd_brickinfo_t *brickinfo = NULL; gd_quorum_status_t quorum_status = NOT_APPLICABLE_QUORUM; gf_boolean_t follows_quorum = _gf_false; @@ -367,6 +369,20 @@ glusterd_do_volume_quorum_action (xlator_t *this, glusterd_volinfo_t *volinfo, glusterd_brick_start (volinfo, brickinfo, _gf_false); } volinfo->quorum_status = quorum_status; + if (quorum_status == MEETS_QUORUM) { + /* bricks might have been restarted and so as the port change + * might have happened + */ + ret = glusterd_store_volinfo (volinfo, + GLUSTERD_VOLINFO_VER_AC_NONE); + if (ret) { + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_VOLINFO_STORE_FAIL, + "Failed to write volinfo for volume %s", + volinfo->volname); + goto out; + } + } out: return; } |