diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2015-09-10 14:19:06 +0530 |
---|---|---|
committer | Dan Lambright <dlambrig@redhat.com> | 2015-10-08 06:38:15 -0700 |
commit | 8725a5edcf5fe59b65d991fad5a73118a9a67bff (patch) | |
tree | ba2f73cbb0ca0d99859040c97322acb5596194fc | |
parent | 37a553575ff8df7ede86e3c69fb48d77bfaccafe (diff) |
Tier/glusterd: Do not allow attach-tier if remove-brick is not committed
When attaching a tier, if there is a pending remove-brick
task, then should not allow attach-tier. Since we are not
supporting add/remove brick on a tiered volume, we won't
able to commit pending remove-brick after attaching the
tier
Back port of>
>Change-Id: Ib434e2e6bc75f0908762f087ad1ca711e6b62818
>BUG: 1261819
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
>Reviewed-on: http://review.gluster.org/12148
>Tested-by: Gluster Build System <jenkins@build.gluster.com>
>Reviewed-by: Dan Lambright <dlambrig@redhat.com>
>Tested-by: Dan Lambright <dlambrig@redhat.com>
(cherry picked from commit bc11be7864eb7f22ad6b529e95bac5a2833f5a01)
Change-Id: I96a6085d215861663eb83a55173282a015976662
BUG: 1258833
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/12245
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index 26ee5c54479..282a78a0e49 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -1537,6 +1537,30 @@ glusterd_op_stage_add_brick (dict_t *dict, char **op_errstr, dict_t *rsp_dict) ret = -1; goto out; } + + if (dict_get(dict, "attach-tier")) { + + /* + * This check is needed because of add/remove brick + * is not supported on a tiered volume. So once a tier + * is attached we cannot commit or stop the remove-brick + * task. Please change this comment once we start supporting + * add/remove brick on a tiered volume. + */ + if (!gd_is_remove_brick_committed (volinfo)) { + + snprintf (msg, sizeof (msg), "An earlier remove-brick " + "task exists for volume %s. Either commit it" + " or stop it before attaching a tier.", + volinfo->volname); + gf_msg (THIS->name, GF_LOG_ERROR, 0, + GD_MSG_OLD_REMOVE_BRICK_EXISTS, "%s", msg); + *op_errstr = gf_strdup (msg); + ret = -1; + goto out; + } + } + ret = dict_get_int32 (dict, "count", &count); if (ret) { gf_msg ("glusterd", GF_LOG_ERROR, errno, |