summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2013-05-09 18:07:59 +0530
committerVijay Bellur <vbellur@redhat.com>2013-05-16 21:41:14 -0700
commit764bb0c1e69294a16af22c82a7e788976a0ff797 (patch)
tree3f333cf7b4423ca12aa59f6018b0d70778000f72 /xlators/mgmt/glusterd/src/glusterd-utils.c
parent8505eadb3032132a1b936951687ac643731c29ec (diff)
glusterd: Start bricks on glusterd startup, only once
The restarting of bricks has been deffered until the cluster 'stabilizes' itself volumes' view. Since glusterd_spawn_daemons is executed everytime a peer 'joins' the cluster, it may inadvertently restart bricks that were taken offline for say, maintenance purposes. This fix avoids that. Change-Id: Ic2a0a9657eb95c82d03cf5eb893322cf55c44eba BUG: 960190 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/5022 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 2153a43df97..6ff3c80924d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2398,10 +2398,12 @@ int
glusterd_spawn_daemons (void *opaque)
{
glusterd_conf_t *conf = THIS->private;
- gf_boolean_t start_bricks = (long) opaque;
+ gf_boolean_t start_bricks = !conf->restart_done;
- if (start_bricks)
+ if (start_bricks) {
glusterd_restart_bricks (conf);
+ conf->restart_done = _gf_true;
+ }
glusterd_restart_gsyncds (conf);
glusterd_restart_rebalance (conf);
return 0;