summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-replace-brick.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
index e883b289f9f..48db4ab3ced 100644
--- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
+++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
@@ -243,6 +243,12 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
glusterd_brickinfo_t *dst_brickinfo = NULL;
gf_boolean_t is_run = _gf_false;
dict_t *ctx = NULL;
+ glusterd_conf_t *priv = NULL;
+ char voldir[PATH_MAX] = {0};
+ char pidfile[PATH_MAX] = {0};
+
+ priv = THIS->private;
+ GF_ASSERT (priv);
ret = dict_get_str (dict, "src-brick", &src_brick);
@@ -416,6 +422,20 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
}
}
+ GLUSTERD_GET_VOLUME_DIR (voldir, volinfo, priv);
+ GLUSTERD_GET_BRICK_PIDFILE (pidfile, voldir,
+ src_brickinfo->hostname,
+ src_brickinfo->path);
+ if (!glusterd_is_service_running (pidfile, NULL)) {
+ snprintf(msg, sizeof(msg), "Source brick %s:%s "
+ "is not online.", src_brickinfo->hostname,
+ src_brickinfo->path);
+ *op_errstr = gf_strdup (msg);
+ ret = -1;
+ goto out;
+ }
+
+
}
dup_dstbrick = gf_strdup (dst_brick);