diff options
author | Anuradha Talur <atalur@redhat.com> | 2016-08-31 15:27:31 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-08-31 15:56:31 -0700 |
commit | 054b09eb5f040ccc0adbb86759da403b49544083 (patch) | |
tree | ae942c73fec67d77c8fd5e14353a83f38d4bdc2c | |
parent | 63d24908e01b24cc21bea584fed4b719fca865f3 (diff) |
event: fix gf_event messages for replace/reset brick op
Change-Id: I80ebeeaffd2b228d7d0796c8d08bc2a051c4ccac
BUG: 1266876
Signed-off-by: Anuradha Talur <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/15370
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
-rw-r--r-- | cli/src/cli-cmd-volume.c | 28 | ||||
-rw-r--r-- | events/eventskeygen.py | 3 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-replace-brick.c | 5 |
3 files changed, 20 insertions, 16 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 2171d357aa5..eb3b2c50fa3 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -1837,10 +1837,10 @@ cli_cmd_volume_reset_brick_cbk (struct cli_state *state, int ret = -1; rpc_clnt_procedure_t *proc = NULL; call_frame_t *frame = NULL; - dict_t *options = NULL; - int sent = 0; - int parse_error = 0; - cli_local_t *local = NULL; + dict_t *options = NULL; + int sent = 0; + int parse_error = 0; + cli_local_t *local = NULL; #ifdef GF_SOLARIS_HOST_OS cli_out ("Command not supported on Solaris"); @@ -1868,14 +1868,22 @@ cli_cmd_volume_reset_brick_cbk (struct cli_state *state, out: if (ret) { - gf_event (EVENT_BRICK_RESET, "Volume reset-brick failed."); cli_cmd_sent_status_get (&sent); if ((sent == 0) && (parse_error == 0)) cli_out ("Volume reset-brick failed"); } else { - gf_event (EVENT_BRICK_RESET, "Volume reset-brick succeeded."); + if (wordcount > 5) { + gf_event (EVENT_BRICK_RESET_COMMIT, + "Volume=%s;source-brick=%s;" + "destination-brick=%s", + (char *)words[2], (char *)words[3], + (char *)words[4]); + } else { + gf_event (EVENT_BRICK_RESET_START, + "Volume=%s;source-brick=%s", + (char *)words[2], (char *)words[3]); + } } - CLI_STACK_DESTROY (frame); return ret; @@ -1921,14 +1929,14 @@ cli_cmd_volume_replace_brick_cbk (struct cli_state *state, out: if (ret) { - gf_event (EVENT_BRICK_REPLACE, "Volume replace-brick failed."); cli_cmd_sent_status_get (&sent); if ((sent == 0) && (parse_error == 0)) cli_out ("Volume replace-brick failed"); } else { - gf_event (EVENT_BRICK_RESET, "Volume replace-brick succeeded."); + gf_event (EVENT_BRICK_REPLACE, + "Volume=%s;source-brick=%s;destination-brick=%s", + (char *)words[2], (char *)words[3], (char *)words[4]); } - CLI_STACK_DESTROY (frame); return ret; diff --git a/events/eventskeygen.py b/events/eventskeygen.py index 480c90e3687..ac5a0f78a3c 100644 --- a/events/eventskeygen.py +++ b/events/eventskeygen.py @@ -31,7 +31,8 @@ keys = ( "EVENT_VOLUME_DELETE", "EVENT_VOLUME_SET", "EVENT_VOLUME_RESET", - "EVENT_BRICK_RESET", + "EVENT_BRICK_RESET_START", + "EVENT_BRICK_RESET_COMMIT", "EVENT_BRICK_REPLACE", #geo-rep events diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c index 687ff004eb5..2fb14208255 100644 --- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c +++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c @@ -146,11 +146,6 @@ __glusterd_handle_replace_brick (rpcsvc_request_t *req) "Received %s request.", gd_rb_op_to_str (cli_op)); - gf_event ((op == GD_OP_REPLACE_BRICK) ? EVENT_BRICK_REPLACE : - EVENT_BRICK_RESET, "received %s request. Source bricks %s," - "destination brick %s.", gd_rb_op_to_str (cli_op), - src_brick, (dst_brick) ? dst_brick : ""); - ret = glusterd_mgmt_v3_initiate_replace_brick_cmd_phases (req, op, dict); |