summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2012-12-24 15:17:13 +0530
committerVijay Bellur <vbellur@redhat.com>2013-01-08 23:39:34 -0800
commit386031c784537e3877a0797f3fc28f9a221246ae (patch)
treea22f8be21a3ac5ae96c1d5941eabce196b744e60 /xlators/mgmt/glusterd/src/glusterd-replace-brick.c
parentf1b2faab5e28e1ea33401022e16aec161fbca353 (diff)
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>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-replace-brick.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-replace-brick.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
index 594825120..b6580a168 100644
--- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
+++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
@@ -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,