glusterd: Set replace-brick id in op ctx only in origin glusterd

Change-Id: I8282f911fb47f4cfb45947b2810d84105c82b5ff
BUG: 889999
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/4352
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
This commit is contained in:
Krishnan Parthasarathi 2012-12-24 15:17:13 +05:30 committed by Vijay Bellur
parent f1b2faab5e
commit 386031c784

View File

@ -1621,27 +1621,31 @@ glusterd_op_replace_brick (dict_t *dict, dict_t *rsp_dict)
if (ret)
goto out;
ctx = glusterd_op_get_ctx();
if (!ctx) {
gf_log (this->name, GF_LOG_ERROR, "Failed to get op_ctx");
ret = -1;
goto out;
}
if ((GF_REPLACE_OP_START != replace_op)) {
/* Set task-id, if available, in op_ctx dict for operations
* other than start
*/
if (!uuid_is_null (volinfo->rep_brick.rb_id)) {
ret = glusterd_copy_uuid_to_dict
(volinfo->rep_brick.rb_id, ctx,
GF_REPLACE_BRICK_TID_KEY);
if (ret) {
gf_log (this->name, GF_LOG_ERROR,
"Failed to set replace-brick-id");
if (is_origin_glusterd ()) {
ctx = glusterd_op_get_ctx();
if (!ctx) {
gf_log (this->name, GF_LOG_ERROR, "Failed to "
"get op_ctx");
ret = -1;
goto out;
}
if (!uuid_is_null (volinfo->rep_brick.rb_id)) {
ret = glusterd_copy_uuid_to_dict
(volinfo->rep_brick.rb_id, ctx,
GF_REPLACE_BRICK_TID_KEY);
if (ret) {
gf_log (this->name, GF_LOG_ERROR,
"Failed to set "
"replace-brick-id");
goto out;
}
}
}
}
ret = rb_update_dstbrick_port (dst_brickinfo, rsp_dict,