diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-brick-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index ced916ea1..f15ec7b18 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -995,6 +995,7 @@ glusterd_op_perform_add_bricks (glusterd_volinfo_t *volinfo, int32_t count, gf_boolean_t restart_needed = 0; char msg[1024] __attribute__((unused)) = {0, }; int caps = 0; + int brickid = 0; GF_ASSERT (volinfo); @@ -1022,11 +1023,17 @@ glusterd_op_perform_add_bricks (glusterd_volinfo_t *volinfo, int32_t count, "type is set %d, need to change it", type); } + brickid = glusterd_get_next_available_brickid (volinfo); + if (brickid < 0) + goto out; while ( i <= count) { ret = glusterd_brickinfo_new_from_brick (brick, &brickinfo); if (ret) goto out; + GLUSTERD_ASSIGN_BRICKID_TO_BRICKINFO (brickinfo, volinfo, + brickid++); + ret = glusterd_resolve_brick (brickinfo); if (ret) goto out; @@ -1931,6 +1938,16 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr) goto out; } + if (GF_OP_CMD_START == cmd && + volinfo->status == GLUSTERD_STATUS_STARTED) { + ret = glusterd_nodesvcs_handle_reconfigure (volinfo); + if (ret) { + gf_log (this->name, GF_LOG_WARNING, + "Unable to reconfigure NFS-Server"); + goto out; + } + } + /* Need to reset the defrag/rebalance status accordingly */ switch (volinfo->rebal.defrag_status) { case GF_DEFRAG_STATUS_FAILED: |