diff options
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 14 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 4 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 7 |
3 files changed, 16 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index b1793937450..330d8e6d2b2 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1196,15 +1196,16 @@ glusterd_op_add_brick (gd1_mgmt_stage_op_req *req) volinfo->version++; - ret = glusterd_volume_compute_cksum (volinfo); - if (ret) - goto out; ret = glusterd_store_update_volume (volinfo); if (ret) goto out; + ret = glusterd_volume_compute_cksum (volinfo); + if (ret) + goto out; + if (GLUSTERD_STATUS_STARTED == volinfo->status) ret = glusterd_check_generate_start_nfs (volinfo); @@ -2175,15 +2176,16 @@ glusterd_op_remove_brick (gd1_mgmt_stage_op_req *req) volinfo->version++; - ret = glusterd_volume_compute_cksum (volinfo); - if (ret) - goto out; ret = glusterd_store_update_volume (volinfo); if (ret) goto out; + ret = glusterd_volume_compute_cksum (volinfo); + if (ret) + goto out; + if (GLUSTERD_STATUS_STARTED == volinfo->status) ret = glusterd_check_generate_start_nfs (volinfo); diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index f3ef79cea85..1e464eae961 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -1058,11 +1058,13 @@ glusterd_store_update_volume (glusterd_volinfo_t *volinfo) if (ret) goto out; - snprintf (buf, sizeof (buf), "%d", volinfo->status); + snprintf (buf, sizeof (buf), "%d", volinfo->version); ret = glusterd_store_save_value (volinfo->shandle, GLUSTERD_STORE_KEY_VOL_VERSION, buf); if (ret) goto out; + + list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) { ret = glusterd_store_create_brick (volinfo, brickinfo); if (ret) diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 6bcbf8c0e46..8ae2b03924c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -1231,7 +1231,7 @@ glusterd_compare_friend_volume (dict_t *vols, int32_t count, int32_t *status) if (ret) goto out; - if (version != volinfo->version) { + if (version > volinfo->version) { //Mismatch detected ret = 0; gf_log ("", GF_LOG_ERROR, "Version of volume %s differ." @@ -1239,7 +1239,10 @@ glusterd_compare_friend_volume (dict_t *vols, int32_t count, int32_t *status) volinfo->volname, volinfo->version, version); *status = GLUSTERD_VOL_COMP_UPDATE_REQ; goto out; - } + } else if (version < volinfo->version) { + *status = GLUSTERD_VOL_COMP_SCS; + goto out; + } //Now, versions are same, compare cksums. // |