diff options
author | Ravishankar N <ravishankar@redhat.com> | 2016-01-18 12:16:31 +0000 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-02-17 01:49:28 -0800 |
commit | 45301bcd97825206f7f19b25a4ad722e7dc13cc6 (patch) | |
tree | 841a3321def4d18d615daf30ae24c4b80eaa3a0e /glusterfsd | |
parent | d132a4704d9b1df55c4c4e56a8389078b80897bd (diff) |
cli/ afr: op_ret for index heal launch
Backport of http://review.gluster.org/#/c/13303/
Problem:
If index heal is launched when some of the bricks are down, glustershd of that
node sends a -1 op_ret to glusterd which eventually propagates it to the CLI.
Also, glusterd sometimes sends an err_str and sometimes not (depending on the
failure happening in the brick-op phase or commit-op phase). So the message that
gets displayed varies in each case:
"Launching heal operation to perform index self heal on volume testvol has been
unsuccessful"
(OR)
"Commit failed on <host>. Please check log file for details."
Fix:
1. Modify afr_xl_op() to return -1 even if index healing of atleast one brick
fails.
2. Ignore glusterd's error string in gf_cli_heal_volume_cbk and print a more
meaningful message.
The patch also fixes a bug in glusterfs_handle_translator_op() where if we
encounter an error in notify of one xlator, we break out of the loop instead of
sending the notify to other xlators.
Change-Id: I957f6c4b4d0a45453ffd5488e425cab5a3e0acca
BUG: 1306922
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/13435
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'glusterfsd')
-rw-r--r-- | glusterfsd/src/glusterfsd-mgmt.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index 877adba2938..da801779079 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -563,6 +563,7 @@ int glusterfs_handle_translator_op (rpcsvc_request_t *req) { int32_t ret = -1; + int32_t op_ret = 0; gd1_mgmt_brick_op_req xlator_req = {0,}; dict_t *input = NULL; xlator_t *xlator = NULL; @@ -632,9 +633,12 @@ glusterfs_handle_translator_op (rpcsvc_request_t *req) ret = dict_get_str (input, key, &xname); xlator = xlator_search_by_name (any, xname); XLATOR_NOTIFY (xlator, GF_EVENT_TRANSLATOR_OP, input, output); + /* If notify fails for an xlator we need to capture it but + * continue with the loop. */ if (ret) - break; + op_ret = -1; } + ret = op_ret; out: glusterfs_xlator_op_response_send (req, ret, "", output); if (input) |