diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-mgmt.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-mgmt.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt.c b/xlators/mgmt/glusterd/src/glusterd-mgmt.c index c905977be..d52532e54 100644 --- a/xlators/mgmt/glusterd/src/glusterd-mgmt.c +++ b/xlators/mgmt/glusterd/src/glusterd-mgmt.c @@ -1285,7 +1285,7 @@ out: int glusterd_mgmt_v3_post_validate (glusterd_conf_t *conf, glusterd_op_t op, - int32_t op_ret, dict_t *req_dict, + int32_t op_ret, dict_t *dict, dict_t *req_dict, char **op_errstr, int npeers) { int32_t ret = -1; @@ -1300,10 +1300,12 @@ glusterd_mgmt_v3_post_validate (glusterd_conf_t *conf, glusterd_op_t op, this = THIS; GF_ASSERT (this); GF_ASSERT (conf); + GF_ASSERT (dict); GF_ASSERT (req_dict); GF_ASSERT (op_errstr); peers = &conf->xaction_peers; + GF_ASSERT (peers); rsp_dict = dict_new (); if (!rsp_dict) { @@ -1312,6 +1314,9 @@ glusterd_mgmt_v3_post_validate (glusterd_conf_t *conf, glusterd_op_t op, goto out; } + /* Copy the contents of dict like missed snaps info to req_dict */ + dict_copy (dict, req_dict); + /* Post Validation on local node */ ret = gd_mgmt_v3_post_validate_fn (op, op_ret, req_dict, op_errstr, rsp_dict); @@ -1344,7 +1349,7 @@ glusterd_mgmt_v3_post_validate (glusterd_conf_t *conf, glusterd_op_t op, } /* Sending Post Validation req to other nodes in the cluster */ - gd_syncargs_init (&args, NULL); + gd_syncargs_init (&args, req_dict); synctask_barrier_init((&args)); peer_cnt = 0; list_for_each_entry (peerinfo, peers, op_peers_list) { @@ -1613,7 +1618,7 @@ glusterd_mgmt_v3_initiate_all_phases (rpcsvc_request_t *req, glusterd_op_t op, /* PRE-COMMIT VALIDATE PHASE */ ret = glusterd_mgmt_v3_pre_validate (conf, op, req_dict, - &op_errstr, npeers); + &op_errstr, npeers); if (ret) { gf_log (this->name, GF_LOG_ERROR, "Pre Validation Failed"); goto out; @@ -1621,7 +1626,7 @@ glusterd_mgmt_v3_initiate_all_phases (rpcsvc_request_t *req, glusterd_op_t op, /* COMMIT OP PHASE */ ret = glusterd_mgmt_v3_commit (conf, op, dict, req_dict, - &op_errstr, npeers); + &op_errstr, npeers); if (ret) { gf_log (this->name, GF_LOG_ERROR, "Commit Op Failed"); goto out; @@ -1632,8 +1637,8 @@ glusterd_mgmt_v3_initiate_all_phases (rpcsvc_request_t *req, glusterd_op_t op, commands other than snapshot. So as of now, I am sending 0 (op_ret as 0). */ - ret = glusterd_mgmt_v3_post_validate (conf, op, 0, req_dict, - &op_errstr, npeers); + ret = glusterd_mgmt_v3_post_validate (conf, op, 0, dict, req_dict, + &op_errstr, npeers); if (ret) { gf_log (this->name, GF_LOG_ERROR, "Post Validation Failed"); goto out; @@ -1795,7 +1800,7 @@ glusterd_mgmt_v3_initiate_snap_phases (rpcsvc_request_t *req, glusterd_op_t op, Who will initiate the cleanup? */ ret = glusterd_mgmt_v3_commit (conf, op, dict, req_dict, - &op_errstr, npeers); + &op_errstr, npeers); if (ret) { gf_log (this->name, GF_LOG_ERROR, "Commit Op Failed"); /* If the main op fails, we should save the error string. @@ -1815,7 +1820,7 @@ unbarrier: if (ret) goto out; ret = glusterd_mgmt_v3_brick_op (conf, op, req_dict, - &op_errstr, npeers); + &op_errstr, npeers); if (ret) { gf_log (this->name, GF_LOG_ERROR, "Brick Ops Failed"); @@ -1831,7 +1836,7 @@ out: op_ret = -1; /* POST-COMMIT VALIDATE PHASE */ - ret = glusterd_mgmt_v3_post_validate (conf, op, op_ret, req_dict, + ret = glusterd_mgmt_v3_post_validate (conf, op, op_ret, dict, req_dict, &op_errstr, npeers); if (ret) { gf_log (this->name, GF_LOG_ERROR, "Post Validation Failed"); |