summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2013-08-07 12:25:07 +0530
committerVijay Bellur <vbellur@redhat.com>2013-08-18 07:24:02 -0700
commite79be3d1655edb2b9f64a13e1fabae601c7d19e4 (patch)
tree1e9a56e33b9b4135d55c20104db5c4e76590600c /xlators/mgmt/glusterd/src/glusterd-volume-ops.c
parentc12fccc4732df63273e8d013fd471e1c8f3b7d22 (diff)
glusterd: Try to start all bricks on 'start force'
A volume would fail to start if any one of the bricks fails staging or fails to start, even with the 'force' option. With this patch, when the 'force' option is given for a volume start, glusterd will continue and start other bricks even if one fails staging or starting. Also did a small fix in changelog, to prevent it crashing when it fails to init. Change-Id: I7efbd9ab13d12d69b0335ae54143fa17586f8f98 BUG: 994375 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/5510 Reviewed-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-ops.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
index 7cac938c13c..c1aea413664 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
@@ -915,7 +915,9 @@ glusterd_op_stage_start_volume (dict_t *dict, char **op_errstr)
continue;
ret = gf_lstat_dir (brickinfo->path, NULL);
- if (ret) {
+ if (ret && (flags & GF_CLI_FLAG_OP_FORCE)) {
+ continue;
+ } else if (ret) {
snprintf (msg, sizeof (msg), "Failed to find "
"brick directory %s for volume %s. "
"Reason : %s", brickinfo->path,
@@ -1704,7 +1706,10 @@ glusterd_op_start_volume (dict_t *dict, char **op_errstr)
list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
ret = glusterd_brick_start (volinfo, brickinfo, _gf_true);
- if (ret)
+ /* If 'force' try to start all bricks regardless of success or
+ * failure
+ */
+ if (!(flags & GF_CLI_FLAG_OP_FORCE) && ret)
goto out;
}