diff options
author | Krishnan Parthasarathi <kparthas@redhat.com> | 2012-10-11 22:43:17 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-10-11 12:04:27 -0700 |
commit | 6be13228c45188b104ffde22cee36fb24db8484d (patch) | |
tree | 22f5a086de7cca2d68ce8188b14e650398769a62 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 1f2dbafc72e6b4942a47dacb3899665118d7ec6b (diff) |
glusterd: volume-start, add-brick and remove-brick to use synctask framework
- Added volume-id validation to glusterd-syncop code.
- All daemons are restarted using synctasks in init().
- glusterd_brick_start has wait/nowait variants to support
volume commands using synctask framework and those that aren't.
Change-Id: Ieec26fe1ea7e5faac88cc7798d93e4cc2b399d34
BUG: 862834
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/3969
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 962e2638f4a..4178ad9db43 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -1155,7 +1155,8 @@ out: int32_t glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo, - glusterd_brickinfo_t *brickinfo) + glusterd_brickinfo_t *brickinfo, + gf_boolean_t wait) { int32_t ret = -1; xlator_t *this = NULL; @@ -1306,7 +1307,11 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo, runner_add_arg (&runner, "--mem-accounting"); runner_log (&runner, "", GF_LOG_DEBUG, "Starting GlusterFS"); - ret = runner_run_nowait (&runner); + if (wait) + ret = runner_run (&runner); + else + ret = runner_run_nowait (&runner); + if (ret) goto out; @@ -3460,7 +3465,8 @@ out: int glusterd_brick_start (glusterd_volinfo_t *volinfo, - glusterd_brickinfo_t *brickinfo) + glusterd_brickinfo_t *brickinfo, + gf_boolean_t wait) { int ret = -1; xlator_t *this = NULL; @@ -3488,7 +3494,7 @@ glusterd_brick_start (glusterd_volinfo_t *volinfo, ret = 0; goto out; } - ret = glusterd_volume_start_glusterfs (volinfo, brickinfo); + ret = glusterd_volume_start_glusterfs (volinfo, brickinfo, wait); if (ret) { gf_log ("", GF_LOG_ERROR, "Unable to start " "glusterfs, ret: %d", ret); @@ -3513,7 +3519,8 @@ glusterd_restart_bricks (glusterd_conf_t *conf) if (volinfo->status == GLUSTERD_STATUS_STARTED) { list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) { - glusterd_brick_start (volinfo, brickinfo); + glusterd_brick_start (volinfo, brickinfo, + _gf_true); } start_nodesvcs = _gf_true; } |