diff options
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 30 | 
1 files changed, 22 insertions, 8 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index e6efe11cf5c..51c81db2f35 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -2557,19 +2557,33 @@ glusterd_volume_stop_glusterfs (glusterd_volinfo_t *volinfo,                   * an actual signal instead.                   */                  if (is_brick_mx_enabled () && last_brick != 1) { -                        gf_msg_debug (this->name, 0, "About to send detach " -                                      "request for brick %s:%s", -                                      brickinfo->hostname, brickinfo->path); +                        ret = send_attach_req (this, brickinfo->rpc, +                                               brickinfo->path, NULL, NULL, +                                               GLUSTERD_BRICK_TERMINATE); +                        if (ret && brickinfo->status == GF_BRICK_STARTED) { +                                gf_msg (this->name, GF_LOG_ERROR, 0, +                                        GD_MSG_BRICK_STOP_FAIL, "Failed to send" +                                        " detach request for brick %s", +                                        brickinfo->path); +                                goto out; +                        } +                        gf_log (this->name, GF_LOG_INFO, "Detach request for " +                                "brick %s:%s is sent successfully", +                                brickinfo->hostname, brickinfo->path); -                        (void) send_attach_req (this, brickinfo->rpc, -                                                brickinfo->path, NULL, NULL, -                                                GLUSTERD_BRICK_TERMINATE);                  } else {                          gf_msg_debug (this->name, 0, "About to stop glusterfsd"                                        " for brick %s:%s", brickinfo->hostname,                                        brickinfo->path); -                        (void) glusterd_brick_terminate (volinfo, brickinfo, -                                                         NULL, 0, &op_errstr); +                        ret = glusterd_brick_terminate (volinfo, brickinfo, +                                                        NULL, 0, &op_errstr); +                        if (ret && brickinfo->status == GF_BRICK_STARTED) { +                                gf_msg (this->name, GF_LOG_ERROR, 0, +                                        GD_MSG_BRICK_STOP_FAIL, "Failed to kill" +                                        " the brick %s", brickinfo->path); +                                goto out; +                        } +                          if (op_errstr) {                                  GF_FREE (op_errstr);                          }  | 
