summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2017-01-09 10:56:13 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-01-18 19:50:33 -0800
commite8669dc707ffd60fea34c4b8b04f545a9169d5ee (patch)
treea4dc3d82ff29b6bd7647efb69c08014a41f78c99 /xlators/mgmt/glusterd/src/glusterd-brick-ops.c
parentc9239db7961afd648f1fa3310e5ce9b8281c8ad2 (diff)
glusterd: bypass add-brick validation with force
Commit c916a2f added a validation to restrict add-brick operation if a replica configuration is changed and any of the bricks belonging to the volume is down. However we should bypass this validation with a force option if users really want to have add-brick to go through at the sake of the corner cases of data loss issue. The original problem of add-brick getting failed when layout is not set will still be a problem with a force option as the issue has to be taken care in the DHT layer. Change-Id: I0ed3df91ea712f77674eb8afc6fdfa577f25a7bb BUG: 1406411 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/16358 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Ravishankar N <ravishankar@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-brick-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index 08a878388a3..938663ba863 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -1724,7 +1724,9 @@ glusterd_op_stage_add_brick (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
}
}
- if (volinfo->replica_count < replica_count) {
+ is_force = dict_get_str_boolean (dict, "force", _gf_false);
+
+ if (volinfo->replica_count < replica_count && !is_force) {
cds_list_for_each_entry (brickinfo, &volinfo->bricks,
brick_list) {
if (gf_uuid_compare (brickinfo->uuid, MY_UUID))
@@ -1812,8 +1814,6 @@ glusterd_op_stage_add_brick (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
goto out;
}
- is_force = dict_get_str_boolean (dict, "force", _gf_false);
-
if (bricks) {
brick_list = gf_strdup (bricks);
all_bricks = gf_strdup (bricks);