diff options
author | Avra Sengupta <asengupt@redhat.com> | 2014-04-23 04:26:24 +0000 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2014-05-06 00:24:39 -0700 |
commit | f846e54b8844decbc8bd73840e7d35b2dcaed2e0 (patch) | |
tree | e0f7be12df60b59c42651cd50bd683510e7cce24 /xlators/mgmt/glusterd/src/glusterd-op-sm.c | |
parent | a05c579f1c3695c4ddead0a5cfc2c92422bd4f8f (diff) |
glusterd: Fetch brick mount_dirs during brick create.
Fetch the mount directory path for a brick, during
volume create, add-brick, and replace-brick.
When a snap-create is missed, use this mount directory
information to create the brick path for the missed snap brick.
Change-Id: Iad3eec96a32cf340f26bdf3f28e2f529e4b77e31
BUG: 1061685
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/7550
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 30658459ba7..d6d72516c67 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -3373,6 +3373,7 @@ glusterd_op_ac_send_stage_op (glusterd_op_sm_event_t *event, void *ctx) xlator_t *this = NULL; glusterd_peerinfo_t *peerinfo = NULL; dict_t *dict = NULL; + dict_t *rsp_dict = NULL; char *op_errstr = NULL; glusterd_op_t op = GD_OP_NONE; uint32_t pending_count = 0; @@ -3384,6 +3385,13 @@ glusterd_op_ac_send_stage_op (glusterd_op_sm_event_t *event, void *ctx) op = glusterd_op_get_op (); + rsp_dict = dict_new(); + if (!rsp_dict) { + gf_log (this->name, GF_LOG_ERROR, "Failed to create rsp_dict"); + ret = -1; + goto out; + } + ret = glusterd_op_build_payload (&dict, &op_errstr, NULL); if (ret) { gf_log (this->name, GF_LOG_ERROR, LOGSTR_BUILD_PAYLOAD, @@ -3401,8 +3409,7 @@ glusterd_op_ac_send_stage_op (glusterd_op_sm_event_t *event, void *ctx) goto out; } - /* rsp_dict NULL from source */ - ret = glusterd_op_stage_validate (op, dict, &op_errstr, NULL); + ret = glusterd_op_stage_validate (op, dict, &op_errstr, rsp_dict); if (ret) { gf_log (this->name, GF_LOG_ERROR, LOGSTR_STAGE_FAIL, gd_op_list[op], "localhost", @@ -3414,6 +3421,9 @@ glusterd_op_ac_send_stage_op (glusterd_op_sm_event_t *event, void *ctx) goto out; } + if (op == GD_OP_REPLACE_BRICK) + glusterd_rb_use_rsp_dict (NULL, rsp_dict); + list_for_each_entry (peerinfo, &priv->peers, uuid_list) { GF_ASSERT (peerinfo); @@ -3447,6 +3457,9 @@ glusterd_op_ac_send_stage_op (glusterd_op_sm_event_t *event, void *ctx) opinfo.pending_count = pending_count; out: + if (rsp_dict) + dict_unref (rsp_dict); + if (dict) dict_unref (dict); if (ret) { @@ -4586,11 +4599,13 @@ glusterd_op_stage_validate (glusterd_op_t op, dict_t *dict, char **op_errstr, switch (op) { case GD_OP_CREATE_VOLUME: - ret = glusterd_op_stage_create_volume (dict, op_errstr); + ret = glusterd_op_stage_create_volume (dict, op_errstr, + rsp_dict); break; case GD_OP_START_VOLUME: - ret = glusterd_op_stage_start_volume (dict, op_errstr); + ret = glusterd_op_stage_start_volume (dict, op_errstr, + rsp_dict); break; case GD_OP_STOP_VOLUME: @@ -4602,7 +4617,8 @@ glusterd_op_stage_validate (glusterd_op_t op, dict_t *dict, char **op_errstr, break; case GD_OP_ADD_BRICK: - ret = glusterd_op_stage_add_brick (dict, op_errstr); + ret = glusterd_op_stage_add_brick (dict, op_errstr, + rsp_dict); break; case GD_OP_REPLACE_BRICK: |