summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
authorGaurav Kumar Garg <garg.gaurav52@gmail.com>2015-09-04 22:10:55 +0530
committerDan Lambright <dlambrig@redhat.com>2015-09-09 17:06:17 -0700
commit61a60de37e7fdfa0b9a9ec83c3edc7a94e4e0ed2 (patch)
tree2c214b47bb4bbbe70f8832d742b3bef72e6c176d /xlators/mgmt/glusterd/src
parentb41579d839a8b6a1447dbb76c85aefdd44cedafe (diff)
glusterd: Do not allow "detach-tier commit" unnecessarily
Backport of: http://review.gluster.org/#/c/12107/ Currently when user execute gluster v detach-tier commit command without starting detach-tier or without giving force option then gluster will success this operation. Detach-tier commit should not allow without giving "force" optioin. >>Reviewed-on: http://review.gluster.org/12107 >>Tested-by: NetBSD Build System <jenkins@build.gluster.org> >>Tested-by: Gluster Build System <jenkins@build.gluster.com> >>Reviewed-by: Atin Mukherjee <amukherj@redhat.com> >>Reviewed-by: Dan Lambright <dlambrig@redhat.com> Change-Id: Id161c288f6f3e0f6b298878a5c35a49fcbd9c6e3 BUG: 1259694 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/12108 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index 0d5f2e179fa..834be85fb36 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -1697,16 +1697,28 @@ glusterd_remove_brick_validate_bricks (gf1_op_commands cmd, int32_t brick_count,
goto out;
}
/* Do not allow commit if the bricks are not decommissioned
- * if its a remove brick commit
+ * if its a remove brick commit or detach-tier commit
*/
- if (cmd == GF_OP_CMD_COMMIT && !brickinfo->decommissioned) {
- snprintf (msg, sizeof (msg), "Brick %s "
- "is not decommissioned. "
- "Use start or force option",
- brick);
- *errstr = gf_strdup (msg);
- ret = -1;
- goto out;
+ if (!brickinfo->decommissioned) {
+ if (cmd == GF_OP_CMD_COMMIT) {
+ snprintf (msg, sizeof (msg), "Brick %s "
+ "is not decommissioned. "
+ "Use start or force option", brick);
+ *errstr = gf_strdup (msg);
+ ret = -1;
+ goto out;
+ }
+
+ if (cmd == GF_OP_CMD_DETACH_COMMIT) {
+ snprintf (msg, sizeof (msg), "Brick's in Hot "
+ "tier is not decommissioned yet. Use "
+ "gluster volume detach-tier <VOLNAME>"
+ " <start | commit | [force]>"
+ " command instead");
+ *errstr = gf_strdup (msg);
+ ret = -1;
+ goto out;
+ }
}
if (glusterd_is_local_brick (THIS, volinfo, brickinfo))