summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/Makefile.am6
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c736
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c233
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handshake.c21
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-mgmt.c148
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c319
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.h6
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c190
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rpc-ops.c15
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-sm.c10
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c140
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c211
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.h11
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-svc-helper.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-svc-helper.h9
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-syncop.c30
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-tier.c1379
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.h37
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-tierd-svc.c503
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-tierd-svc.h41
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c803
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.h35
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c374
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-ops.c92
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c15
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h65
26 files changed, 126 insertions, 5305 deletions
diff --git a/xlators/mgmt/glusterd/src/Makefile.am b/xlators/mgmt/glusterd/src/Makefile.am
index f15b66d10a8..10f389faf59 100644
--- a/xlators/mgmt/glusterd/src/Makefile.am
+++ b/xlators/mgmt/glusterd/src/Makefile.am
@@ -12,7 +12,7 @@ glusterd_la_SOURCES = glusterd.c glusterd-handler.c glusterd-sm.c \
glusterd-store.c glusterd-handshake.c glusterd-pmap.c \
glusterd-volgen.c glusterd-rebalance.c \
glusterd-quota.c glusterd-bitrot.c glusterd-geo-rep.c \
- glusterd-replace-brick.c glusterd-log-ops.c glusterd-tier.c \
+ glusterd-replace-brick.c glusterd-log-ops.c \
glusterd-volume-ops.c glusterd-brick-ops.c glusterd-mountbroker.c \
glusterd-syncop.c glusterd-hooks.c glusterd-volume-set.c \
glusterd-locks.c glusterd-snapshot.c glusterd-mgmt-handler.c \
@@ -22,8 +22,7 @@ glusterd_la_SOURCES = glusterd.c glusterd-handler.c glusterd-sm.c \
glusterd-nfs-svc.c glusterd-quotad-svc.c glusterd-svc-helper.c \
glusterd-conn-helper.c glusterd-snapd-svc.c glusterd-snapd-svc-helper.c \
glusterd-bitd-svc.c glusterd-scrub-svc.c glusterd-server-quorum.c \
- glusterd-reset-brick.c glusterd-tierd-svc.c glusterd-tierd-svc-helper.c \
- glusterd-shd-svc.c glusterd-shd-svc-helper.c \
+ glusterd-reset-brick.c glusterd-shd-svc.c glusterd-shd-svc-helper.c \
glusterd-gfproxyd-svc.c glusterd-gfproxyd-svc-helper.c
@@ -43,7 +42,6 @@ noinst_HEADERS = glusterd.h glusterd-utils.h glusterd-op-sm.h \
glusterd-quotad-svc.h glusterd-svc-helper.h glusterd-snapd-svc.h \
glusterd-snapd-svc-helper.h glusterd-rcu.h glusterd-bitd-svc.h \
glusterd-scrub-svc.h glusterd-server-quorum.h glusterd-errno.h \
- glusterd-tierd-svc.h glusterd-tierd-svc-helper.h \
glusterd-shd-svc.h glusterd-shd-svc-helper.h \
glusterd-gfproxyd-svc.h glusterd-gfproxyd-svc-helper.h \
$(CONTRIBDIR)/userspace-rcu/rculist-extra.h
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index 4eef53eb2bd..1c9809f0254 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -27,35 +27,6 @@
/* misc */
-gf_boolean_t
-glusterd_is_tiering_supported(char *op_errstr)
-{
- xlator_t *this = NULL;
- glusterd_conf_t *conf = NULL;
- gf_boolean_t supported = _gf_false;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO("glusterd", this, out);
-
- conf = this->private;
- GF_VALIDATE_OR_GOTO(this->name, conf, out);
-
- if (conf->op_version < GD_OP_VERSION_3_7_0)
- goto out;
-
- supported = _gf_true;
-
-out:
- if (!supported && op_errstr != NULL && conf)
- sprintf(op_errstr,
- "Tier operation failed. The cluster is "
- "operating at version %d. Tiering"
- " is unavailable in this version.",
- conf->op_version);
-
- return supported;
-}
-
/* In this function, we decide, based on the 'count' of the brick,
where to add it in the current volume. 'count' tells us already
how many of the given bricks are added. other argument are self-
@@ -214,10 +185,6 @@ gd_rmbr_validate_replica_count(glusterd_volinfo_t *volinfo,
int replica_nodes = 0;
switch (volinfo->type) {
- case GF_CLUSTER_TYPE_TIER:
- ret = 1;
- goto out;
-
case GF_CLUSTER_TYPE_NONE:
case GF_CLUSTER_TYPE_DISPERSE:
snprintf(err_str, err_len,
@@ -401,44 +368,6 @@ __glusterd_handle_add_brick(rpcsvc_request_t *req)
total_bricks = volinfo->brick_count + brick_count;
- if (dict_getn(dict, "attach-tier", SLEN("attach-tier"))) {
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- snprintf(err_str, sizeof(err_str), "Volume %s is already a tier.",
- volname);
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VOL_ALREADY_TIER, "%s",
- err_str);
- ret = -1;
- goto out;
- }
-
- if (glusterd_is_tiering_supported(err_str) == _gf_false) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VERSION_UNSUPPORTED,
- "Tiering not supported at this version");
- ret = -1;
- goto out;
- }
-
- ret = dict_get_int32n(dict, "hot-type", SLEN("hot-type"), &type);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "failed to get type from dictionary");
- goto out;
- }
-
- goto brick_val;
- }
-
- ret = glusterd_disallow_op_for_tier(volinfo, GD_OP_ADD_BRICK, -1);
- if (ret) {
- snprintf(err_str, sizeof(err_str),
- "Add-brick operation is "
- "not supported on a tiered volume %s",
- volname);
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_OP_UNSUPPORTED, "%s",
- err_str);
- goto out;
- }
-
if (!stripe_count && !replica_count) {
if (volinfo->type == GF_CLUSTER_TYPE_NONE)
goto brick_val;
@@ -616,43 +545,6 @@ subvol_matcher_destroy(int *subvols)
GF_FREE(subvols);
}
-int
-glusterd_set_detach_bricks(dict_t *dict, glusterd_volinfo_t *volinfo)
-{
- char key[64] = "";
- char value[2048] = ""; /* hostname + path */
- int brick_num = 0;
- int hot_brick_num = 0;
- glusterd_brickinfo_t *brickinfo;
- int ret = 0;
- int32_t len = 0;
-
- /* cold tier bricks at tail of list so use reverse iteration */
- cds_list_for_each_entry_reverse(brickinfo, &volinfo->bricks, brick_list)
- {
- brick_num++;
- if (brick_num > volinfo->tier_info.cold_brick_count) {
- hot_brick_num++;
- sprintf(key, "brick%d", hot_brick_num);
- len = snprintf(value, sizeof(value), "%s:%s", brickinfo->hostname,
- brickinfo->path);
- if ((len < 0) || (len >= sizeof(value))) {
- return -1;
- }
-
- ret = dict_set_str(dict, key, strdup(value));
- if (ret)
- break;
- }
- }
-
- ret = dict_set_int32n(dict, "count", SLEN("count"), hot_brick_num);
- if (ret)
- return -1;
-
- return hot_brick_num;
-}
-
static int
glusterd_remove_brick_validate_arbiters(glusterd_volinfo_t *volinfo,
int32_t count, int32_t replica_count,
@@ -805,14 +697,6 @@ __glusterd_handle_remove_brick(rpcsvc_request_t *req)
goto out;
}
- if ((volinfo->type == GF_CLUSTER_TYPE_TIER) &&
- (glusterd_is_tiering_supported(err_str) == _gf_false)) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VERSION_UNSUPPORTED,
- "Tiering not supported at this version");
- ret = -1;
- goto out;
- }
-
ret = dict_get_int32n(dict, "command", SLEN("command"), &cmd);
if (ret) {
snprintf(err_str, sizeof(err_str),
@@ -823,15 +707,6 @@ __glusterd_handle_remove_brick(rpcsvc_request_t *req)
goto out;
}
- ret = glusterd_disallow_op_for_tier(volinfo, GD_OP_REMOVE_BRICK, cmd);
- if (ret) {
- snprintf(err_str, sizeof(err_str),
- "Removing brick from a Tier volume is not allowed");
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_OP_UNSUPPORTED, "%s",
- err_str);
- goto out;
- }
-
ret = dict_get_int32n(dict, "replica-count", SLEN("replica-count"),
&replica_count);
if (!ret) {
@@ -883,8 +758,7 @@ __glusterd_handle_remove_brick(rpcsvc_request_t *req)
/* Do not allow remove-brick if the bricks given is less than
the replica count or stripe count */
- if (!replica_count && (volinfo->type != GF_CLUSTER_TYPE_NONE) &&
- (volinfo->type != GF_CLUSTER_TYPE_TIER)) {
+ if (!replica_count && (volinfo->type != GF_CLUSTER_TYPE_NONE)) {
if (volinfo->dist_leaf_count && (count % volinfo->dist_leaf_count)) {
snprintf(err_str, sizeof(err_str),
"Remove brick "
@@ -897,18 +771,13 @@ __glusterd_handle_remove_brick(rpcsvc_request_t *req)
}
}
- /* subvol match is not required for tiered volume*/
if ((volinfo->type != GF_CLUSTER_TYPE_NONE) &&
- (volinfo->type != GF_CLUSTER_TYPE_TIER) &&
(volinfo->subvol_count > 1)) {
ret = subvol_matcher_init(&subvols, volinfo->subvol_count);
if (ret)
goto out;
}
- if (volinfo->type == GF_CLUSTER_TYPE_TIER)
- count = glusterd_set_detach_bricks(dict, volinfo);
-
brickinfo_list = GF_CALLOC(count, sizeof(*brickinfo_list),
gf_common_mt_pointer);
if (!brickinfo_list) {
@@ -949,18 +818,10 @@ __glusterd_handle_remove_brick(rpcsvc_request_t *req)
(volinfo->brick_count <= volinfo->dist_leaf_count))
continue;
- /* Find which subvolume the brick belongs to.
- * subvol match is not required for tiered volume
- *
- */
- if (volinfo->type != GF_CLUSTER_TYPE_TIER)
- subvol_matcher_update(subvols, volinfo, brickinfo);
+ subvol_matcher_update(subvols, volinfo, brickinfo);
}
- /* Check if the bricks belong to the same subvolumes.*/
- /* subvol match is not required for tiered volume*/
if ((volinfo->type != GF_CLUSTER_TYPE_NONE) &&
- (volinfo->type != GF_CLUSTER_TYPE_TIER) &&
(volinfo->subvol_count > 1)) {
ret = subvol_matcher_verify(subvols, volinfo, err_str, sizeof(err_str),
vol_type, replica_count);
@@ -1218,10 +1079,7 @@ glusterd_op_perform_add_bricks(glusterd_volinfo_t *volinfo, int32_t count,
}
brickinfo->statfs_fsid = brickstat.f_fsid;
}
- /* hot tier bricks are added to head of brick list */
- if (dict_getn(dict, "attach-tier", SLEN("attach-tier"))) {
- cds_list_add(&brickinfo->brick_list, &volinfo->bricks);
- } else if (stripe_count || replica_count) {
+ if (stripe_count || replica_count) {
add_brick_at_right_order(brickinfo, volinfo, (i - 1), stripe_count,
replica_count);
} else {
@@ -1287,16 +1145,8 @@ glusterd_op_perform_add_bricks(glusterd_volinfo_t *volinfo, int32_t count,
if (count)
brick = strtok_r(brick_list + 1, " \n", &saveptr);
- /* This check needs to be added to distinguish between
- * attach-tier commands and add-brick commands.
- * When a tier is attached, adding is done via add-brick
- * and setting of pending xattrs shouldn't be done for
- * attach-tiers as they are virtually new volumes.
- */
if (glusterd_is_volume_replicate(volinfo)) {
- if (replica_count &&
- !dict_getn(dict, "attach-tier", SLEN("attach-tier")) &&
- conf->op_version >= GD_OP_VERSION_3_7_10) {
+ if (replica_count && conf->op_version >= GD_OP_VERSION_3_7_10) {
is_valid_add_brick = _gf_true;
ret = generate_dummy_client_volfiles(volinfo);
if (ret) {
@@ -1504,9 +1354,8 @@ glusterd_op_stage_add_brick(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
/* Do not allow add-brick for stopped volumes when replica-count
* is being increased.
*/
- if (conf->op_version >= GD_OP_VERSION_3_7_10 &&
- !dict_getn(dict, "attach-tier", SLEN("attach-tier")) &&
- replica_count && GLUSTERD_STATUS_STOPPED == volinfo->status) {
+ if (conf->op_version >= GD_OP_VERSION_3_7_10 && replica_count &&
+ GLUSTERD_STATUS_STOPPED == volinfo->status) {
ret = -1;
snprintf(msg, sizeof(msg),
" Volume must not be in"
@@ -1601,28 +1450,6 @@ glusterd_op_stage_add_brick(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
goto out;
}
- if (dict_getn(dict, "attach-tier", SLEN("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_int32n(dict, "count", SLEN("count"), &count);
if (ret) {
gf_msg("glusterd", GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
@@ -1781,50 +1608,22 @@ 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 or detach-tier commit
+ * if its a remove brick commit
*/
- 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 ||
- cmd_defrag == GF_DEFRAG_CMD_DETACH_COMMIT) {
- snprintf(msg, sizeof(msg),
- "Bricks in Hot "
- "tier are not decommissioned yet. Use "
- "gluster volume tier <VOLNAME> "
- "detach start to start the decommission process");
- *errstr = gf_strdup(msg);
- ret = -1;
- goto out;
- }
- } else {
- if ((cmd == GF_OP_CMD_DETACH_COMMIT ||
- (cmd_defrag == GF_DEFRAG_CMD_DETACH_COMMIT)) &&
- (volinfo->rebal.defrag_status == GF_DEFRAG_STATUS_STARTED)) {
- snprintf(msg, sizeof(msg),
- "Bricks in Hot "
- "tier are not decommissioned yet. Wait for "
- "the detach to complete using gluster volume "
- "tier <VOLNAME> status.");
- *errstr = gf_strdup(msg);
- ret = -1;
- goto out;
- }
+ if (!brickinfo->decommissioned && 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 (glusterd_is_local_brick(THIS, volinfo, brickinfo)) {
switch (cmd) {
case GF_OP_CMD_START:
- case GF_OP_CMD_DETACH_START:
goto check;
case GF_OP_CMD_NONE:
default:
@@ -1832,8 +1631,6 @@ glusterd_remove_brick_validate_bricks(gf1_op_commands cmd, int32_t brick_count,
}
switch (cmd_defrag) {
- case GF_DEFRAG_CMD_DETACH_START:
- break;
case GF_DEFRAG_CMD_NONE:
default:
continue;
@@ -1974,18 +1771,6 @@ glusterd_op_stage_remove_brick(dict_t *dict, char **op_errstr)
case GF_OP_CMD_STATUS:
ret = 0;
goto out;
- case GF_OP_CMD_DETACH_START:
- if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
- snprintf(msg, sizeof(msg),
- "volume %s is not a tier "
- "volume",
- volinfo->volname);
- errstr = gf_strdup(msg);
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VOL_NOT_TIER, "%s",
- errstr);
- goto out;
- }
- /* Fall through */
case GF_OP_CMD_START: {
if ((volinfo->type == GF_CLUSTER_TYPE_REPLICATE) &&
dict_getn(dict, "replica-count", SLEN("replica-count"))) {
@@ -2000,21 +1785,12 @@ glusterd_op_stage_remove_brick(dict_t *dict, char **op_errstr)
}
if (GLUSTERD_STATUS_STARTED != volinfo->status) {
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- snprintf(msg, sizeof(msg),
- "Volume %s needs "
- "to be started before detach-tier "
- "(you can use 'force' or 'commit' "
- "to override this behavior)",
- volinfo->volname);
- } else {
- snprintf(msg, sizeof(msg),
- "Volume %s needs "
- "to be started before remove-brick "
- "(you can use 'force' or 'commit' "
- "to override this behavior)",
- volinfo->volname);
- }
+ snprintf(msg, sizeof(msg),
+ "Volume %s needs "
+ "to be started before remove-brick "
+ "(you can use 'force' or 'commit' "
+ "to override this behavior)",
+ volinfo->volname);
errstr = gf_strdup(msg);
gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VOL_NOT_STARTED,
"%s", errstr);
@@ -2091,50 +1867,9 @@ glusterd_op_stage_remove_brick(dict_t *dict, char **op_errstr)
}
case GF_OP_CMD_STOP:
- case GF_OP_CMD_STOP_DETACH_TIER:
ret = 0;
break;
- case GF_OP_CMD_DETACH_COMMIT:
- if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
- snprintf(msg, sizeof(msg),
- "volume %s is not a tier "
- "volume",
- volinfo->volname);
- errstr = gf_strdup(msg);
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VOL_NOT_TIER, "%s",
- errstr);
- goto out;
- }
- if (volinfo->decommission_in_progress) {
- errstr = gf_strdup(
- "use 'force' option as migration "
- "is in progress");
- goto out;
- }
- if (volinfo->rebal.defrag_status == GF_DEFRAG_STATUS_FAILED) {
- errstr = gf_strdup(
- "use 'force' option as migration "
- "has failed");
- goto out;
- }
-
- ret = glusterd_remove_brick_validate_bricks(
- cmd, brick_count, dict, volinfo, &errstr, GF_DEFRAG_CMD_NONE);
- if (ret)
- goto out;
-
- /* If geo-rep is configured, for this volume, it should be
- * stopped.
- */
- param.volinfo = volinfo;
- ret = glusterd_check_geo_rep_running(&param, op_errstr);
- if (ret || param.is_active) {
- ret = -1;
- goto out;
- }
- break;
-
case GF_OP_CMD_COMMIT:
if (volinfo->decommission_in_progress) {
errstr = gf_strdup(
@@ -2167,18 +1902,11 @@ glusterd_op_stage_remove_brick(dict_t *dict, char **op_errstr)
break;
- case GF_OP_CMD_DETACH_COMMIT_FORCE:
- if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
- snprintf(msg, sizeof(msg),
- "volume %s is not a tier "
- "volume",
- volinfo->volname);
- errstr = gf_strdup(msg);
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VOL_NOT_TIER, "%s",
- errstr);
- goto out;
- }
case GF_OP_CMD_COMMIT_FORCE:
+ case GF_OP_CMD_DETACH_START:
+ case GF_OP_CMD_DETACH_COMMIT:
+ case GF_OP_CMD_DETACH_COMMIT_FORCE:
+ case GF_OP_CMD_STOP_DETACH_TIER:
break;
}
ret = 0;
@@ -2272,48 +2000,6 @@ glusterd_remove_brick_migrate_cbk(glusterd_volinfo_t *volinfo,
return ret;
}
-static int
-glusterd_op_perform_attach_tier(dict_t *dict, glusterd_volinfo_t *volinfo,
- int count, char *bricks)
-{
- int ret = 0;
- int replica_count = 0;
- int type = 0;
-
- /*
- * Store the new (cold) tier's structure until the graph is generated.
- * If there is a failure before the graph is generated the
- * structure will revert to its original state.
- */
- volinfo->tier_info.cold_dist_leaf_count = volinfo->dist_leaf_count;
- volinfo->tier_info.cold_type = volinfo->type;
- volinfo->tier_info.cold_brick_count = volinfo->brick_count;
- volinfo->tier_info.cold_replica_count = volinfo->replica_count;
- volinfo->tier_info.cold_disperse_count = volinfo->disperse_count;
- volinfo->tier_info.cold_redundancy_count = volinfo->redundancy_count;
-
- ret = dict_get_int32n(dict, "replica-count", SLEN("replica-count"),
- &replica_count);
- if (!ret)
- volinfo->tier_info.hot_replica_count = replica_count;
- else
- volinfo->tier_info.hot_replica_count = 1;
- volinfo->tier_info.hot_brick_count = count;
- ret = dict_get_int32n(dict, "hot-type", SLEN("hot-type"), &type);
- volinfo->tier_info.hot_type = type;
- ret = dict_set_int32n(dict, "type", SLEN("type"), GF_CLUSTER_TYPE_TIER);
-
- if (!ret)
- ret = dict_set_nstrn(volinfo->dict, "features.ctr-enabled",
- SLEN("features.ctr-enabled"), "on", SLEN("on"));
-
- if (!ret)
- ret = dict_set_nstrn(volinfo->dict, "cluster.tier-mode",
- SLEN("cluster.tier-mode"), "cache", SLEN("cache"));
-
- return ret;
-}
-
int
glusterd_op_add_brick(dict_t *dict, char **op_errstr)
{
@@ -2361,11 +2047,6 @@ glusterd_op_add_brick(dict_t *dict, char **op_errstr)
goto out;
}
- if (dict_getn(dict, "attach-tier", SLEN("attach-tier"))) {
- gf_msg_debug(THIS->name, 0, "Adding tier");
- glusterd_op_perform_attach_tier(dict, volinfo, count, bricks);
- }
-
ret = glusterd_op_perform_add_bricks(volinfo, count, bricks, dict);
if (ret) {
gf_msg("glusterd", GF_LOG_ERROR, 0, GD_MSG_BRICK_ADD_FAIL,
@@ -2394,95 +2075,6 @@ out:
}
int
-glusterd_op_add_tier_brick(dict_t *dict, char **op_errstr)
-{
- int ret = 0;
- char *volname = NULL;
- glusterd_conf_t *priv = NULL;
- glusterd_volinfo_t *volinfo = NULL;
- xlator_t *this = NULL;
- char *bricks = NULL;
- int32_t count = 0;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO("glusterd", this, out);
-
- priv = this->private;
- GF_VALIDATE_OR_GOTO(this->name, priv, out);
-
- ret = dict_get_strn(dict, "volname", SLEN("volname"), &volname);
-
- if (ret) {
- gf_msg("glusterd", GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "Unable to get volume name");
- goto out;
- }
-
- ret = glusterd_volinfo_find(volname, &volinfo);
-
- if (ret) {
- gf_msg("glusterd", GF_LOG_ERROR, EINVAL, GD_MSG_VOL_NOT_FOUND,
- "Volume not found");
- goto out;
- }
-
- ret = dict_get_int32n(dict, "count", SLEN("count"), &count);
- if (ret) {
- gf_msg("glusterd", GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "Unable to get count");
- goto out;
- }
-
- ret = dict_get_strn(dict, "bricks", SLEN("bricks"), &bricks);
- if (ret) {
- gf_msg("glusterd", GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "Unable to get bricks");
- goto out;
- }
-
- if (dict_getn(dict, "attach-tier", SLEN("attach-tier"))) {
- gf_msg_debug(THIS->name, 0, "Adding tier");
- glusterd_op_perform_attach_tier(dict, volinfo, count, bricks);
- }
-
- ret = glusterd_op_perform_add_bricks(volinfo, count, bricks, dict);
- if (ret) {
- gf_msg("glusterd", GF_LOG_ERROR, 0, GD_MSG_BRICK_ADD_FAIL,
- "Unable to add bricks");
- goto out;
- }
- if (priv->op_version <= GD_OP_VERSION_3_10_0) {
- ret = glusterd_store_volinfo(volinfo,
- GLUSTERD_VOLINFO_VER_AC_INCREMENT);
- if (ret)
- goto out;
- } else {
- /*
- * The cluster is operating at version greater than
- * gluster-3.10.0. So no need to store volfiles
- * in commit phase, the same will be done
- * in post validate phase with v3 framework.
- */
- }
-
- if (GLUSTERD_STATUS_STARTED == volinfo->status)
- ret = glusterd_svcs_manager(volinfo);
-
-out:
- return ret;
-}
-
-void
-glusterd_op_perform_detach_tier(glusterd_volinfo_t *volinfo)
-{
- volinfo->type = volinfo->tier_info.cold_type;
- volinfo->replica_count = volinfo->tier_info.cold_replica_count;
- volinfo->disperse_count = volinfo->tier_info.cold_disperse_count;
- volinfo->redundancy_count = volinfo->tier_info.cold_redundancy_count;
- volinfo->dist_leaf_count = volinfo->tier_info.cold_dist_leaf_count;
-}
-
-int
glusterd_op_remove_brick(dict_t *dict, char **op_errstr)
{
int ret = -1;
@@ -2498,8 +2090,6 @@ glusterd_op_remove_brick(dict_t *dict, char **op_errstr)
int force = 0;
gf1_op_commands cmd = 0;
int32_t replica_count = 0;
- glusterd_brickinfo_t *brickinfo = NULL;
- glusterd_brickinfo_t *tmp = NULL;
char *task_id_str = NULL;
xlator_t *this = NULL;
dict_t *bricks_dict = NULL;
@@ -2507,11 +2097,6 @@ glusterd_op_remove_brick(dict_t *dict, char **op_errstr)
int start_remove = 0;
uint32_t commit_hash = 0;
int defrag_cmd = 0;
- int detach_commit = 0;
- void *tier_info = NULL;
- char *cold_shd_key = NULL;
- char *hot_shd_key = NULL;
- int delete_key = 1;
glusterd_conf_t *conf = NULL;
this = THIS;
@@ -2542,7 +2127,7 @@ glusterd_op_remove_brick(dict_t *dict, char **op_errstr)
}
cmd = flag;
- if ((GF_OP_CMD_START == cmd) || (GF_OP_CMD_DETACH_START == cmd))
+ if (GF_OP_CMD_START == cmd)
start_remove = 1;
/* Set task-id, if available, in ctx dict for operations other than
@@ -2582,35 +2167,6 @@ glusterd_op_remove_brick(dict_t *dict, char **op_errstr)
goto out;
case GF_OP_CMD_STOP:
- case GF_OP_CMD_STOP_DETACH_TIER: {
- /* Fall back to the old volume file */
- cds_list_for_each_entry_safe(brickinfo, tmp, &volinfo->bricks,
- brick_list)
- {
- if (!brickinfo->decommissioned)
- continue;
- brickinfo->decommissioned = 0;
- }
- ret = glusterd_create_volfiles_and_notify_services(volinfo);
- if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0,
- GD_MSG_VOLFILE_CREATE_FAIL, "failed to create volfiles");
- goto out;
- }
-
- ret = glusterd_store_volinfo(volinfo,
- GLUSTERD_VOLINFO_VER_AC_INCREMENT);
- if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, GD_MSG_VOLINFO_SET_FAIL,
- "failed to store volinfo");
- goto out;
- }
-
- ret = 0;
- goto out;
- }
-
- case GF_OP_CMD_DETACH_START:
case GF_OP_CMD_START:
/* Reset defrag status to 'NOT STARTED' whenever a
* remove-brick/rebalance command is issued to remove
@@ -2637,43 +2193,6 @@ glusterd_op_remove_brick(dict_t *dict, char **op_errstr)
force = 1;
break;
- case GF_OP_CMD_DETACH_COMMIT:
- case GF_OP_CMD_DETACH_COMMIT_FORCE:
- glusterd_op_perform_detach_tier(volinfo);
- detach_commit = 1;
-
- /* Disabling ctr when detaching a tier, since
- * currently tier is the only consumer of ctr.
- * Revisit this code when this constraint no
- * longer exist.
- */
- dict_deln(volinfo->dict, "features.ctr-enabled",
- SLEN("features.ctr-enabled"));
- dict_deln(volinfo->dict, "cluster.tier-mode",
- SLEN("cluster.tier-mode"));
-
- hot_shd_key = gd_get_shd_key(volinfo->tier_info.hot_type);
- cold_shd_key = gd_get_shd_key(volinfo->tier_info.cold_type);
- if (hot_shd_key) {
- /*
- * Since post detach, shd graph will not contain hot
- * tier. So we need to clear option set for hot tier.
- * For a tiered volume there can be different key
- * for both hot and cold. If hot tier is shd compatible
- * then we need to remove the configured value when
- * detaching a tier, only if the key's are different or
- * cold key is NULL. So we will set delete_key first,
- * and if cold key is not null and they are equal then
- * we will clear the flag. Otherwise we will delete the
- * key.
- */
- if (cold_shd_key)
- delete_key = strcmp(hot_shd_key, cold_shd_key);
- if (delete_key)
- dict_del(volinfo->dict, hot_shd_key);
- }
- /* fall through */
-
case GF_OP_CMD_COMMIT_FORCE:
if (volinfo->decommission_in_progress) {
@@ -2693,6 +2212,11 @@ glusterd_op_remove_brick(dict_t *dict, char **op_errstr)
ret = 0;
force = 1;
break;
+ case GF_OP_CMD_DETACH_START:
+ case GF_OP_CMD_DETACH_COMMIT_FORCE:
+ case GF_OP_CMD_DETACH_COMMIT:
+ case GF_OP_CMD_STOP_DETACH_TIER:
+ break;
}
ret = dict_get_int32n(dict, "count", SLEN("count"), &count);
@@ -2701,10 +2225,6 @@ glusterd_op_remove_brick(dict_t *dict, char **op_errstr)
"Unable to get count");
goto out;
}
-
- if (volinfo->type == GF_CLUSTER_TYPE_TIER)
- count = glusterd_set_detach_bricks(dict, volinfo);
-
/* Save the list of bricks for later usage only on starting a
* remove-brick. Right now this is required for displaying the task
* parameters with task status in volume status.
@@ -2757,12 +2277,6 @@ glusterd_op_remove_brick(dict_t *dict, char **op_errstr)
i++;
}
- if (detach_commit) {
- /* Clear related information from volinfo */
- tier_info = ((void *)(&volinfo->tier_info));
- memset(tier_info, 0, sizeof(volinfo->tier_info));
- }
-
if (start_remove)
volinfo->rebal.dict = dict_ref(bricks_dict);
@@ -2785,8 +2299,7 @@ glusterd_op_remove_brick(dict_t *dict, char **op_errstr)
* volumes undergoing a detach operation, they should not
* be modified here.
*/
- if ((replica_count == 1) && (cmd != GF_OP_CMD_DETACH_COMMIT) &&
- (cmd != GF_OP_CMD_DETACH_COMMIT_FORCE)) {
+ if (replica_count == 1) {
if (volinfo->type == GF_CLUSTER_TYPE_REPLICATE) {
volinfo->type = GF_CLUSTER_TYPE_NONE;
/* backward compatibility */
@@ -2847,8 +2360,6 @@ glusterd_op_remove_brick(dict_t *dict, char **op_errstr)
}
/* perform the rebalance operations */
defrag_cmd = GF_DEFRAG_CMD_START_FORCE;
- if (cmd == GF_OP_CMD_DETACH_START)
- defrag_cmd = GF_DEFRAG_CMD_START_DETACH_TIER;
/*
* We need to set this *before* we issue commands to the
* bricks, or else we might end up setting it after the bricks
@@ -2995,194 +2506,19 @@ out:
}
int
-__glusterd_handle_add_tier_brick(rpcsvc_request_t *req)
-{
- int32_t ret = -1;
- gf_cli_req cli_req = {{
- 0,
- }};
- dict_t *dict = NULL;
- char *bricks = NULL;
- char *volname = NULL;
- int brick_count = 0;
- void *cli_rsp = NULL;
- char err_str[2048] = "";
- gf_cli_rsp rsp = {
- 0,
- };
- glusterd_volinfo_t *volinfo = NULL;
- xlator_t *this = NULL;
- int32_t replica_count = 0;
- int32_t arbiter_count = 0;
- int type = 0;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO("glusterd", this, out);
-
- GF_VALIDATE_OR_GOTO(this->name, req, out);
-
- ret = xdr_to_generic(req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
- if (ret < 0) {
- /*failed to decode msg*/
- req->rpc_err = GARBAGE_ARGS;
- snprintf(err_str, sizeof(err_str), "Garbage args received");
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_GARBAGE_ARGS, "%s",
- err_str);
- goto out;
- }
-
- gf_msg(this->name, GF_LOG_INFO, 0, GD_MSG_ADD_BRICK_REQ_RECVD,
- "Received add brick req");
-
- if (cli_req.dict.dict_len) {
- /* Unserialize the dictionary */
- dict = dict_new();
-
- ret = dict_unserialize(cli_req.dict.dict_val, cli_req.dict.dict_len,
- &dict);
- if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, errno,
- GD_MSG_DICT_UNSERIALIZE_FAIL,
- "failed to "
- "unserialize req-buffer to dictionary");
- snprintf(err_str, sizeof(err_str),
- "Unable to decode "
- "the command");
- goto out;
- }
- }
-
- ret = dict_get_strn(dict, "volname", SLEN("volname"), &volname);
-
- if (ret) {
- snprintf(err_str, sizeof(err_str),
- "Unable to get volume "
- "name");
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED, "%s",
- err_str);
- goto out;
- }
-
- ret = glusterd_volinfo_find(volname, &volinfo);
- if (ret) {
- snprintf(err_str, sizeof(err_str),
- "Unable to get volinfo "
- "for volume name %s",
- volname);
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VOLINFO_GET_FAIL, "%s",
- err_str);
- goto out;
- }
-
- ret = dict_get_int32n(dict, "count", SLEN("count"), &brick_count);
- if (ret) {
- snprintf(err_str, sizeof(err_str),
- "Unable to get volume "
- "brick count");
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED, "%s",
- err_str);
- goto out;
- }
-
- ret = dict_get_int32n(dict, "replica-count", SLEN("replica-count"),
- &replica_count);
- if (!ret) {
- gf_msg(this->name, GF_LOG_INFO, errno, GD_MSG_DICT_GET_SUCCESS,
- "replica-count is %d", replica_count);
- }
-
- ret = dict_get_int32n(dict, "arbiter-count", SLEN("arbiter-count"),
- &arbiter_count);
- if (!ret) {
- gf_msg(this->name, GF_LOG_INFO, errno, GD_MSG_DICT_GET_SUCCESS,
- "arbiter-count is %d", arbiter_count);
- }
-
- if (!dict_getn(dict, "force", SLEN("force"))) {
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "Failed to get flag");
- ret = -1;
- goto out;
- }
-
- if (glusterd_is_tiering_supported(err_str) == _gf_false) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VERSION_UNSUPPORTED,
- "Tiering not supported at this version");
- ret = -1;
- goto out;
- }
-
- if (dict_getn(dict, "attach-tier", SLEN("attach-tier"))) {
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- snprintf(err_str, sizeof(err_str), "Volume %s is already a tier.",
- volname);
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VOL_ALREADY_TIER, "%s",
- err_str);
- ret = -1;
- goto out;
- }
-
- ret = dict_get_int32n(dict, "hot-type", SLEN("hot-type"), &type);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "failed to get type from dictionary");
- goto out;
- }
- }
-
- ret = dict_get_strn(dict, "bricks", SLEN("bricks"), &bricks);
- if (ret) {
- snprintf(err_str, sizeof(err_str),
- "Unable to get volume "
- "bricks");
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED, "%s",
- err_str);
- goto out;
- }
-
- if (type != volinfo->type) {
- ret = dict_set_int32n(dict, "type", SLEN("type"), type);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_SET_FAILED,
- "failed to set the new type in dict");
- goto out;
- }
- }
-
- ret = glusterd_mgmt_v3_initiate_all_phases(req, GD_OP_ADD_TIER_BRICK, dict);
-
-out:
- if (ret) {
- rsp.op_ret = -1;
- rsp.op_errno = 0;
- if (err_str[0] == '\0')
- snprintf(err_str, sizeof(err_str), "Operation failed");
- rsp.op_errstr = err_str;
- cli_rsp = &rsp;
- glusterd_to_cli(req, cli_rsp, NULL, 0, NULL, (xdrproc_t)xdr_gf_cli_rsp,
- dict);
- ret = 0; /*sent error to cli, prevent second reply*/
- }
-
- free(cli_req.dict.dict_val); /*its malloced by xdr*/
-
- return ret;
-}
-
-int
glusterd_handle_add_tier_brick(rpcsvc_request_t *req)
{
- return glusterd_big_locked_handler(req, __glusterd_handle_add_tier_brick);
+ return 0;
}
int
glusterd_handle_attach_tier(rpcsvc_request_t *req)
{
- return glusterd_big_locked_handler(req, __glusterd_handle_add_brick);
+ return 0;
}
int
glusterd_handle_detach_tier(rpcsvc_request_t *req)
{
- return glusterd_big_locked_handler(req, __glusterd_handle_remove_brick);
+ return 0;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index b28ca1a9e54..18bc0e83af2 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -323,81 +323,6 @@ _build_option_key(dict_t *d, char *k, data_t *v, void *tmp)
}
int
-glusterd_add_tier_volume_detail_to_dict(glusterd_volinfo_t *volinfo,
- dict_t *dict, int count)
-{
- int ret = -1;
- char key[64] = {
- 0,
- };
- int keylen;
-
- GF_ASSERT(volinfo);
- GF_ASSERT(dict);
-
- keylen = snprintf(key, sizeof(key), "volume%d.cold_type", count);
- ret = dict_set_int32n(dict, key, keylen, volinfo->tier_info.cold_type);
- if (ret)
- goto out;
-
- keylen = snprintf(key, sizeof(key), "volume%d.cold_brick_count", count);
- ret = dict_set_int32n(dict, key, keylen,
- volinfo->tier_info.cold_brick_count);
- if (ret)
- goto out;
-
- keylen = snprintf(key, sizeof(key), "volume%d.cold_dist_count", count);
- ret = dict_set_int32n(dict, key, keylen,
- volinfo->tier_info.cold_dist_leaf_count);
- if (ret)
- goto out;
-
- keylen = snprintf(key, sizeof(key), "volume%d.cold_replica_count", count);
- ret = dict_set_int32n(dict, key, keylen,
- volinfo->tier_info.cold_replica_count);
- if (ret)
- goto out;
-
- keylen = snprintf(key, sizeof(key), "volume%d.cold_arbiter_count", count);
- ret = dict_set_int32n(dict, key, keylen, volinfo->arbiter_count);
- if (ret)
- goto out;
-
- keylen = snprintf(key, sizeof(key), "volume%d.cold_disperse_count", count);
- ret = dict_set_int32n(dict, key, keylen,
- volinfo->tier_info.cold_disperse_count);
- if (ret)
- goto out;
-
- keylen = snprintf(key, sizeof(key), "volume%d.cold_redundancy_count",
- count);
- ret = dict_set_int32n(dict, key, keylen,
- volinfo->tier_info.cold_redundancy_count);
- if (ret)
- goto out;
-
- keylen = snprintf(key, sizeof(key), "volume%d.hot_type", count);
- ret = dict_set_int32n(dict, key, keylen, volinfo->tier_info.hot_type);
- if (ret)
- goto out;
-
- keylen = snprintf(key, sizeof(key), "volume%d.hot_brick_count", count);
- ret = dict_set_int32n(dict, key, keylen,
- volinfo->tier_info.hot_brick_count);
- if (ret)
- goto out;
-
- keylen = snprintf(key, sizeof(key), "volume%d.hot_replica_count", count);
- ret = dict_set_int32n(dict, key, keylen,
- volinfo->tier_info.hot_replica_count);
- if (ret)
- goto out;
-
-out:
- return ret;
-}
-
-int
glusterd_add_arbiter_info_to_bricks(glusterd_volinfo_t *volinfo,
dict_t *volumes, int count)
{
@@ -406,41 +331,18 @@ glusterd_add_arbiter_info_to_bricks(glusterd_volinfo_t *volinfo,
};
int keylen;
int i = 0;
- int start_index = 0;
int ret = 0;
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- /*TODO: Add info for hot tier once attach tier of arbiter
- * volumes is supported. */
-
- /* cold tier */
- if (volinfo->tier_info.cold_replica_count == 1 ||
- volinfo->arbiter_count != 1)
- return 0;
-
- i = start_index = volinfo->tier_info.hot_brick_count + 1;
- for (; i <= volinfo->brick_count; i++) {
- if ((i - start_index + 1) % volinfo->tier_info.cold_replica_count !=
- 0)
- continue;
- keylen = snprintf(key, sizeof(key), "volume%d.brick%d.isArbiter",
- count, i);
- ret = dict_set_int32n(volumes, key, keylen, 1);
- if (ret)
- return ret;
- }
- } else {
- if (volinfo->replica_count == 1 || volinfo->arbiter_count != 1)
- return 0;
- for (i = 1; i <= volinfo->brick_count; i++) {
- if (i % volinfo->replica_count != 0)
- continue;
- keylen = snprintf(key, sizeof(key), "volume%d.brick%d.isArbiter",
- count, i);
- ret = dict_set_int32n(volumes, key, keylen, 1);
- if (ret)
- return ret;
- }
+ if (volinfo->replica_count == 1 || volinfo->arbiter_count != 1)
+ return 0;
+ for (i = 1; i <= volinfo->brick_count; i++) {
+ if (i % volinfo->replica_count != 0)
+ continue;
+ keylen = snprintf(key, sizeof(key), "volume%d.brick%d.isArbiter", count,
+ i);
+ ret = dict_set_int32n(volumes, key, keylen, 1);
+ if (ret)
+ return ret;
}
return 0;
}
@@ -495,18 +397,6 @@ glusterd_add_volume_detail_to_dict(glusterd_volinfo_t *volinfo, dict_t *volumes,
if (ret)
goto out;
- keylen = snprintf(key, sizeof(key), "volume%d.hot_brick_count", count);
- ret = dict_set_int32n(volumes, key, keylen,
- volinfo->tier_info.hot_brick_count);
- if (ret)
- goto out;
-
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- ret = glusterd_add_tier_volume_detail_to_dict(volinfo, volumes, count);
- if (ret)
- goto out;
- }
-
keylen = snprintf(key, sizeof(key), "volume%d.dist_count", count);
ret = dict_set_int32n(volumes, key, keylen, volinfo->dist_leaf_count);
if (ret)
@@ -4385,17 +4275,6 @@ __glusterd_handle_status_volume(rpcsvc_request_t *req)
goto out;
}
- if ((cmd & GF_CLI_STATUS_TIERD) &&
- (conf->op_version < GD_OP_VERSION_3_10_0)) {
- snprintf(err_str, sizeof(err_str),
- "The cluster is operating "
- "at a lesser version than %d. Getting the status of "
- "tierd is not allowed in this state",
- GD_OP_VERSION_3_6_0);
- ret = -1;
- goto out;
- }
-
if ((cmd & GF_CLI_STATUS_SCRUB) &&
(conf->op_version < GD_OP_VERSION_3_7_0)) {
snprintf(err_str, sizeof(err_str),
@@ -5412,14 +5291,11 @@ glusterd_get_state(rpcsvc_request_t *req, dict_t *dict)
uint32_t get_state_cmd = 0;
uint64_t memtotal = 0;
uint64_t memfree = 0;
- int start_index = 0;
char id_str[64] = {
0,
};
char *vol_type_str = NULL;
- char *hot_tier_type_str = NULL;
- char *cold_tier_type_str = NULL;
char transport_type_str[STATUS_STRLEN] = {
0,
@@ -5666,26 +5542,11 @@ glusterd_get_state(rpcsvc_request_t *req, dict_t *dict)
brickinfo->hostname);
/* Determine which one is the arbiter brick */
if (volinfo->arbiter_count == 1) {
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- if (volinfo->tier_info.cold_replica_count != 1) {
- start_index = volinfo->tier_info.hot_brick_count + 1;
- if (count >= start_index &&
- ((count - start_index + 1) %
- volinfo->tier_info.cold_replica_count ==
- 0)) {
- fprintf(fp,
- "Volume%d.Brick%d."
- "is_arbiter: 1\n",
- count_bkp, count);
- }
- }
- } else {
- if (count % volinfo->replica_count == 0) {
- fprintf(fp,
- "Volume%d.Brick%d."
- "is_arbiter: 1\n",
- count_bkp, count);
- }
+ if (count % volinfo->replica_count == 0) {
+ fprintf(fp,
+ "Volume%d.Brick%d."
+ "is_arbiter: 1\n",
+ count_bkp, count);
}
}
/* Add following information only for bricks
@@ -5701,14 +5562,6 @@ glusterd_get_state(rpcsvc_request_t *req, dict_t *dict)
fprintf(fp, "Volume%d.Brick%d.status: %s\n", count_bkp, count,
brickinfo->status ? "Started" : "Stopped");
- /*FIXME: This is a hacky way of figuring out whether a
- * brick belongs to the hot or cold tier */
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- fprintf(fp, "Volume%d.Brick%d.tier: %s\n", count_bkp, count,
- count <= volinfo->tier_info.hot_brick_count ? "Hot"
- : "Cold");
- }
-
ret = sys_statvfs(brickinfo->path, &brickstat);
if (ret) {
gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_FILE_OP_FAILED,
@@ -5790,51 +5643,6 @@ glusterd_get_state(rpcsvc_request_t *req, dict_t *dict)
fprintf(fp, "Volume%d.shd_svc.inited: %s\n", count,
volinfo->shd.svc.inited ? "True" : "False");
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- ret = glusterd_volume_get_hot_tier_type_str(volinfo,
- &hot_tier_type_str);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_STATE_STR_GET_FAILED,
- "Failed to get hot tier type for "
- "volume: %s",
- volinfo->volname);
- goto out;
- }
-
- ret = glusterd_volume_get_cold_tier_type_str(volinfo,
- &cold_tier_type_str);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_STATE_STR_GET_FAILED,
- "Failed to get cold tier type for "
- "volume: %s",
- volinfo->volname);
- goto out;
- }
-
- fprintf(fp, "Volume%d.tier_info.cold_tier_type: %s\n", count,
- cold_tier_type_str);
- fprintf(fp, "Volume%d.tier_info.cold_brick_count: %d\n", count,
- volinfo->tier_info.cold_brick_count);
- fprintf(fp, "Volume%d.tier_info.cold_replica_count: %d\n", count,
- volinfo->tier_info.cold_replica_count);
- fprintf(fp, "Volume%d.tier_info.cold_disperse_count: %d\n", count,
- volinfo->tier_info.cold_disperse_count);
- fprintf(fp, "Volume%d.tier_info.cold_dist_leaf_count: %d\n", count,
- volinfo->tier_info.cold_dist_leaf_count);
- fprintf(fp, "Volume%d.tier_info.cold_redundancy_count: %d\n", count,
- volinfo->tier_info.cold_redundancy_count);
- fprintf(fp, "Volume%d.tier_info.hot_tier_type: %s\n", count,
- hot_tier_type_str);
- fprintf(fp, "Volume%d.tier_info.hot_brick_count: %d\n", count,
- volinfo->tier_info.hot_brick_count);
- fprintf(fp, "Volume%d.tier_info.hot_replica_count: %d\n", count,
- volinfo->tier_info.hot_replica_count);
- fprintf(fp, "Volume%d.tier_info.promoted: %d\n", count,
- volinfo->tier_info.promoted);
- fprintf(fp, "Volume%d.tier_info.demoted: %d\n", count,
- volinfo->tier_info.demoted);
- }
-
if (volinfo->rep_brick.src_brick && volinfo->rep_brick.dst_brick) {
fprintf(fp, "Volume%d.replace_brick.src: %s:%s\n", count,
volinfo->rep_brick.src_brick->hostname,
@@ -6641,3 +6449,14 @@ struct rpcsvc_program gd_svc_cli_trusted_progs = {
.actors = gd_svc_cli_trusted_actors,
.synctask = _gf_true,
};
+
+/* As we cant remove the handlers, I'm moving the tier based
+ * handlers to this file as we no longer have gluster-tier.c
+ * and other tier.c files
+ */
+
+int
+glusterd_handle_tier(rpcsvc_request_t *req)
+{
+ return 0;
+}
diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c
index 26cfdd1fba5..52f24f6d713 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handshake.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c
@@ -21,7 +21,6 @@
#include "glusterd-snapshot-utils.h"
#include "glusterd-svc-mgmt.h"
#include "glusterd-snapd-svc-helper.h"
-#include "glusterd-tierd-svc-helper.h"
#include "glusterd-volgen.h"
#include "glusterd-quotad-svc.h"
#include "glusterd-messages.h"
@@ -253,26 +252,6 @@ build_volfile_path(char *volume_id, char *path, size_t path_len,
goto out;
}
- volid_ptr = strstr(volume_id, "tierd/");
- if (volid_ptr) {
- volid_ptr = strchr(volid_ptr, '/');
- if (!volid_ptr) {
- ret = -1;
- goto out;
- }
- volid_ptr++;
-
- ret = glusterd_volinfo_find(volid_ptr, &volinfo);
- if (ret == -1) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VOLINFO_GET_FAIL,
- "Couldn't find volinfo");
- goto out;
- }
- glusterd_svc_build_tierd_volfile_path(volinfo, path, path_len);
- ret = 0;
- goto out;
- }
-
volid_ptr = strstr(volume_id, "gluster/");
if (volid_ptr) {
volid_ptr = strchr(volid_ptr, '/');
diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt.c b/xlators/mgmt/glusterd/src/glusterd-mgmt.c
index b66d44f9d0a..30c53c39dff 100644
--- a/xlators/mgmt/glusterd/src/glusterd-mgmt.c
+++ b/xlators/mgmt/glusterd/src/glusterd-mgmt.c
@@ -160,7 +160,6 @@ gd_mgmt_v3_pre_validate_fn(glusterd_op_t op, dict_t *dict, char **op_errstr,
goto out;
}
break;
- case GD_OP_ADD_TIER_BRICK:
case GD_OP_ADD_BRICK:
ret = glusterd_op_stage_add_brick(dict, op_errstr, rsp_dict);
if (ret) {
@@ -188,19 +187,6 @@ gd_mgmt_v3_pre_validate_fn(glusterd_op_t op, dict_t *dict, char **op_errstr,
goto out;
}
break;
- case GD_OP_TIER_START_STOP:
- case GD_OP_TIER_STATUS:
- case GD_OP_DETACH_TIER_STATUS:
- case GD_OP_REMOVE_TIER_BRICK:
- ret = glusterd_op_stage_tier(dict, op_errstr, rsp_dict);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_COMMAND_NOT_FOUND,
- "tier "
- "prevalidation failed");
- goto out;
- }
- break;
-
case GD_OP_RESET_BRICK:
ret = glusterd_reset_brick_prevalidate(dict, op_errstr, rsp_dict);
if (ret) {
@@ -296,7 +282,6 @@ gd_mgmt_v3_commit_fn(glusterd_op_t op, dict_t *dict, char **op_errstr,
{
int32_t ret = -1;
xlator_t *this = NULL;
- int32_t cmd = 0;
this = THIS;
GF_ASSERT(this);
@@ -370,51 +355,6 @@ gd_mgmt_v3_commit_fn(glusterd_op_t op, dict_t *dict, char **op_errstr,
}
break;
}
- case GD_OP_TIER_START_STOP: {
- ret = glusterd_op_tier_start_stop(dict, op_errstr, rsp_dict);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_COMMIT_OP_FAIL,
- "tier commit failed.");
- goto out;
- }
- break;
- }
- case GD_OP_REMOVE_TIER_BRICK: {
- ret = glusterd_op_remove_tier_brick(dict, op_errstr, rsp_dict);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_COMMIT_OP_FAIL,
- "tier detach commit failed.");
- goto out;
- }
- ret = dict_get_int32n(dict, "rebalance-command",
- SLEN("rebalance-command"), &cmd);
- if (ret) {
- gf_msg_debug(this->name, 0, "cmd not found");
- goto out;
- }
-
- if (cmd != GF_DEFRAG_CMD_DETACH_STOP)
- break;
- }
- case GD_OP_DETACH_TIER_STATUS:
- case GD_OP_TIER_STATUS: {
- ret = glusterd_op_tier_status(dict, op_errstr, rsp_dict, op);
- if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, GD_MSG_COMMIT_OP_FAIL,
- "tier status commit failed");
- goto out;
- }
- break;
- }
- case GD_OP_ADD_TIER_BRICK: {
- ret = glusterd_op_add_tier_brick(dict, op_errstr);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_COMMIT_OP_FAIL,
- "tier add-brick commit failed.");
- goto out;
- }
- break;
- }
case GD_OP_PROFILE_VOLUME: {
ret = glusterd_op_stats_volume(dict, op_errstr, rsp_dict);
if (ret) {
@@ -453,7 +393,6 @@ gd_mgmt_v3_post_validate_fn(glusterd_op_t op, int32_t op_ret, dict_t *dict,
xlator_t *this = NULL;
char *volname = NULL;
glusterd_volinfo_t *volinfo = NULL;
- glusterd_svc_t *svc = NULL;
this = THIS;
GF_ASSERT(this);
@@ -518,12 +457,6 @@ gd_mgmt_v3_post_validate_fn(glusterd_op_t op, int32_t op_ret, dict_t *dict,
goto out;
}
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- svc = &(volinfo->tierd.svc);
- ret = svc->manager(svc, volinfo, PROC_START_NO_WAIT);
- if (ret)
- goto out;
- }
break;
}
case GD_OP_STOP_VOLUME: {
@@ -544,49 +477,6 @@ gd_mgmt_v3_post_validate_fn(glusterd_op_t op, int32_t op_ret, dict_t *dict,
}
break;
}
- case GD_OP_ADD_TIER_BRICK: {
- ret = dict_get_strn(dict, "volname", SLEN("volname"), &volname);
- if (ret) {
- gf_msg("glusterd", GF_LOG_ERROR, 0, GD_MSG_DICT_GET_FAILED,
- "Unable to get"
- " volume name");
- goto out;
- }
-
- ret = glusterd_volinfo_find(volname, &volinfo);
- if (ret) {
- gf_msg("glusterd", GF_LOG_ERROR, EINVAL, GD_MSG_VOL_NOT_FOUND,
- "Unable to "
- "allocate memory");
- goto out;
- }
- ret = glusterd_create_volfiles_and_notify_services(volinfo);
- if (ret)
- goto out;
- ret = glusterd_store_volinfo(volinfo,
- GLUSTERD_VOLINFO_VER_AC_INCREMENT);
- if (ret)
- goto out;
- ret = dict_get_strn(dict, "volname", SLEN("volname"), &volname);
- if (ret) {
- gf_msg("glusterd", GF_LOG_ERROR, 0, GD_MSG_DICT_GET_FAILED,
- "Unable to get"
- " volume name");
- goto out;
- }
-
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_SET_FAILED,
- "dict set "
- "failed");
- goto out;
- }
- ret = -1;
- svc = &(volinfo->tierd.svc);
- ret = svc->manager(svc, volinfo, PROC_START_NO_WAIT);
- if (ret)
- goto out;
- }
default:
break;
@@ -851,7 +741,6 @@ glusterd_pre_validate_aggr_rsp_dict(glusterd_op_t op, dict_t *aggr, dict_t *rsp)
break;
case GD_OP_START_VOLUME:
case GD_OP_ADD_BRICK:
- case GD_OP_ADD_TIER_BRICK:
ret = glusterd_aggr_brick_mount_dirs(aggr, rsp);
if (ret) {
gf_msg(this->name, GF_LOG_ERROR, 0,
@@ -870,10 +759,6 @@ glusterd_pre_validate_aggr_rsp_dict(glusterd_op_t op, dict_t *aggr, dict_t *rsp)
goto out;
}
case GD_OP_STOP_VOLUME:
- case GD_OP_TIER_STATUS:
- case GD_OP_DETACH_TIER_STATUS:
- case GD_OP_TIER_START_STOP:
- case GD_OP_REMOVE_TIER_BRICK:
case GD_OP_PROFILE_VOLUME:
case GD_OP_DEFRAG_BRICK_VOLUME:
case GD_OP_REBALANCE:
@@ -1193,7 +1078,6 @@ glusterd_mgmt_v3_build_payload(dict_t **req, char **op_errstr, dict_t *dict,
case GD_OP_DEFRAG_BRICK_VOLUME:
case GD_OP_REPLACE_BRICK:
case GD_OP_RESET_BRICK:
- case GD_OP_ADD_TIER_BRICK:
case GD_OP_PROFILE_VOLUME: {
ret = dict_get_strn(dict, "volname", SLEN("volname"), &volname);
if (ret) {
@@ -1234,12 +1118,6 @@ glusterd_mgmt_v3_build_payload(dict_t **req, char **op_errstr, dict_t *dict,
dict_copy(dict, req_dict);
} break;
- case GD_OP_TIER_START_STOP:
- case GD_OP_REMOVE_TIER_BRICK:
- case GD_OP_DETACH_TIER_STATUS:
- case GD_OP_TIER_STATUS:
- dict_copy(dict, req_dict);
- break;
default:
break;
}
@@ -1669,7 +1547,6 @@ glusterd_mgmt_v3_commit(glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict,
uuid_t peer_uuid = {0};
xlator_t *this = NULL;
glusterd_conf_t *conf = NULL;
- int32_t count = 0;
this = THIS;
GF_ASSERT(this);
@@ -1743,22 +1620,9 @@ glusterd_mgmt_v3_commit(glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict,
*/
if (peerinfo->generation > txn_generation)
continue;
-
- if (!peerinfo->connected) {
- if (op == GD_OP_TIER_STATUS || op == GD_OP_DETACH_TIER_STATUS) {
- ret = dict_get_int32n(args.dict, "count", SLEN("count"),
- &count);
- if (ret)
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_GET_FAILED,
- "failed to get index");
- count++;
- ret = dict_set_int32n(args.dict, "count", SLEN("count"), count);
- if (ret)
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_GET_FAILED,
- "failed to set index");
- }
+ if (!peerinfo->connected)
continue;
- }
+
if (op != GD_OP_SYNC_VOLUME &&
peerinfo->state.state != GD_FRIEND_STATE_BEFRIENDED)
continue;
@@ -1937,14 +1801,6 @@ glusterd_mgmt_v3_post_validate(glusterd_op_t op, int32_t op_ret, dict_t *dict,
goto out;
}
- /* Copy the contents of dict like missed snaps info to req_dict */
- if (op != GD_OP_REMOVE_TIER_BRICK)
- /* dict and req_dict has the same values during remove tier
- * brick (detach start) So this rewrite make the remove brick
- * id to become empty.
- * Avoiding to copy it retains the value. */
- dict_copy(dict, req_dict);
-
/* Post Validation on local node */
ret = gd_mgmt_v3_post_validate_fn(op, op_ret, req_dict, op_errstr,
rsp_dict);
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index bee19e821fd..02f02e9e83f 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -103,10 +103,6 @@ int
glusterd_bricks_select_rebalance_volume(dict_t *dict, char **op_errstr,
struct cds_list_head *selected);
-int
-glusterd_bricks_select_tier_volume(dict_t *dict, char **op_errstr,
- struct cds_list_head *selected);
-
int32_t
glusterd_txn_opinfo_dict_init()
{
@@ -618,8 +614,6 @@ glusterd_brick_op_build_payload(glusterd_op_t op,
goto out;
} break;
case GD_OP_REBALANCE:
- case GD_OP_DETACH_TIER_STATUS:
- case GD_OP_TIER_STATUS:
case GD_OP_DEFRAG_BRICK_VOLUME:
brick_req = GF_CALLOC(1, sizeof(*brick_req),
gf_gld_mt_mop_brick_req_t);
@@ -633,10 +627,7 @@ glusterd_brick_op_build_payload(glusterd_op_t op,
ret = glusterd_volinfo_find(volname, &volinfo);
if (ret)
goto out;
- if (volinfo->type == GF_CLUSTER_TYPE_TIER)
- snprintf(name, sizeof(name), "%s-tier-dht", volname);
- else
- snprintf(name, sizeof(name), "%s-dht", volname);
+ snprintf(name, sizeof(name), "%s-dht", volname);
brick_req->name = gf_strdup(name);
break;
@@ -1543,81 +1534,6 @@ out:
}
return ret;
}
-static int
-glusterd_water_limit_check(glusterd_volinfo_t *volinfo, gf_boolean_t is_hi,
- char **op_errstr)
-{
- int ret = -1;
- char *default_value = NULL;
- char *temp = NULL;
- uint64_t wm = 0;
- uint64_t default_wm = 0;
- struct volopt_map_entry *vmap = NULL;
- xlator_t *this = NULL;
- extern struct volopt_map_entry glusterd_volopt_map[];
- char msg[2048] = {0};
-
- this = THIS;
- GF_ASSERT(this);
-
- if (is_hi)
- ret = glusterd_volinfo_get(volinfo, "cluster.watermark-low", &temp);
- else
- ret = glusterd_volinfo_get(volinfo, "cluster.watermark-hi", &temp);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VOLINFO_GET_FAIL,
- "failed to get watermark");
- goto out;
- }
-
- gf_string2bytesize_uint64(temp, &wm);
-
- if (is_hi)
- for (vmap = glusterd_volopt_map; vmap->key; vmap++) {
- if (strcmp(vmap->key, "cluster.watermark-hi") == 0)
- default_value = vmap->value;
- }
- else
- for (vmap = glusterd_volopt_map; vmap->key; vmap++) {
- if (strcmp(vmap->key, "cluster.watermark-low") == 0)
- default_value = vmap->value;
- }
-
- gf_string2bytesize_uint64(default_value, &default_wm);
-
- if (is_hi) {
- if (default_wm <= wm) {
- snprintf(msg, sizeof(msg),
- "Resetting hi-watermark "
- "to default will make it lower or equal to "
- "the low-watermark, which is an invalid "
- "configuration state. Please lower the "
- "low-watermark first to the desired value "
- "and then reset the hi-watermark.");
- ret = -1;
- goto out;
- }
- } else {
- if (default_wm >= wm) {
- snprintf(msg, sizeof(msg),
- "Resetting low-watermark "
- "to default will make it higher or equal to "
- "the hi-watermark, which is an invalid "
- "configuration state. Please raise the "
- "hi-watermark first to the desired value "
- "and then reset the low-watermark.");
- ret = -1;
- goto out;
- }
- }
-out:
- if (msg[0] != '\0') {
- gf_msg(THIS->name, GF_LOG_ERROR, 0, GD_MSG_TIER_WATERMARK_RESET_FAIL,
- "%s", msg);
- *op_errstr = gf_strdup(msg);
- }
- return ret;
-}
static int
glusterd_op_stage_reset_volume(dict_t *dict, char **op_errstr)
@@ -1670,10 +1586,6 @@ glusterd_op_stage_reset_volume(dict_t *dict, char **op_errstr)
if (exists == -1) {
ret = -1;
goto out;
- } else if (strcmp(key, "cluster.watermark-low") == 0) {
- ret = glusterd_water_limit_check(volinfo, _gf_false, op_errstr);
- } else if (strcmp(key, "cluster.watermark-hi") == 0) {
- ret = glusterd_water_limit_check(volinfo, _gf_true, op_errstr);
}
if (ret)
goto out;
@@ -1832,17 +1744,6 @@ glusterd_op_stage_status_volume(dict_t *dict, char **op_errstr)
goto out;
}
- if ((cmd & GF_CLI_STATUS_TIERD) &&
- (priv->op_version < GD_OP_VERSION_3_10_0)) {
- snprintf(msg, sizeof(msg),
- "The cluster is operating at "
- "version less than %d. Getting the "
- "status of tierd is not allowed in this state.",
- GD_OP_VERSION_3_10_0);
- ret = -1;
- goto out;
- }
-
if ((cmd & GF_CLI_STATUS_SNAPD) &&
(priv->op_version < GD_OP_VERSION_3_6_0)) {
snprintf(msg, sizeof(msg),
@@ -1923,15 +1824,6 @@ glusterd_op_stage_status_volume(dict_t *dict, char **op_errstr)
volname);
goto out;
}
- } else if ((cmd & GF_CLI_STATUS_TIERD) != 0) {
- if (!glusterd_is_tierd_enabled(volinfo)) {
- ret = -1;
- snprintf(msg, sizeof(msg),
- "Volume %s does not have "
- "tierd enabled.",
- volname);
- goto out;
- }
} else if ((cmd & GF_CLI_STATUS_SCRUB) != 0) {
if (!glusterd_is_bitrot_enabled(volinfo)) {
ret = -1;
@@ -2168,12 +2060,6 @@ glusterd_options_reset(glusterd_volinfo_t *volinfo, char *key,
if (ret)
goto out;
}
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- svc = &(volinfo->tierd.svc);
- ret = svc->reconfigure(volinfo);
- if (ret)
- goto out;
- }
svc = &(volinfo->gfproxyd.svc);
ret = svc->reconfigure(volinfo);
if (ret)
@@ -2631,13 +2517,6 @@ glusterd_op_set_all_volume_options(xlator_t *this, dict_t *dict,
goto out;
}
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- svc = &(volinfo->tierd.svc);
- ret = svc->reconfigure(volinfo);
- if (ret)
- goto out;
- }
-
svc = &(volinfo->gfproxyd.svc);
ret = svc->reconfigure(volinfo);
if (ret)
@@ -3031,12 +2910,6 @@ glusterd_op_set_volume(dict_t *dict, char **errstr)
if (ret)
goto out;
}
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- svc = &(volinfo->tierd.svc);
- ret = svc->reconfigure(volinfo);
- if (ret)
- goto out;
- }
svc = &(volinfo->gfproxyd.svc);
ret = svc->reconfigure(volinfo);
if (ret)
@@ -3083,13 +2956,6 @@ glusterd_op_set_volume(dict_t *dict, char **errstr)
goto out;
}
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- svc = &(volinfo->tierd.svc);
- ret = svc->reconfigure(volinfo);
- if (ret)
- goto out;
- }
-
svc = &(volinfo->gfproxyd.svc);
ret = svc->reconfigure(volinfo);
if (ret)
@@ -3425,8 +3291,6 @@ _add_task_to_dict(dict_t *dict, glusterd_volinfo_t *volinfo, int op, int index)
GF_ASSERT(this);
switch (op) {
- case GD_OP_REMOVE_TIER_BRICK:
- /* Fall through */
case GD_OP_REMOVE_BRICK:
snprintf(key, sizeof(key), "task%d", index);
ret = _add_remove_bricks_to_dict(dict, volinfo, key);
@@ -3436,7 +3300,6 @@ _add_task_to_dict(dict_t *dict, glusterd_volinfo_t *volinfo, int op, int index)
"Failed to add remove bricks to dict");
goto out;
}
- case GD_OP_TIER_MIGRATE:
case GD_OP_REBALANCE:
uuid_str = gf_strdup(uuid_utoa(volinfo->rebal.rebalance_id));
status = volinfo->rebal.defrag_status;
@@ -3491,25 +3354,12 @@ glusterd_aggregate_task_status(dict_t *rsp_dict, glusterd_volinfo_t *volinfo)
int ret = -1;
int tasks = 0;
xlator_t *this = NULL;
- glusterd_conf_t *conf = NULL;
this = THIS;
GF_ASSERT(this);
- conf = this->private;
if (!gf_uuid_is_null(volinfo->rebal.rebalance_id)) {
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- if (conf->op_version > GD_OP_VERSION_3_10_0)
- goto done;
- if (volinfo->rebal.op == GD_OP_REMOVE_BRICK)
- ret = _add_task_to_dict(rsp_dict, volinfo,
- GD_OP_REMOVE_TIER_BRICK, tasks);
- else if (volinfo->rebal.op == GD_OP_REBALANCE)
- ret = _add_task_to_dict(rsp_dict, volinfo, GD_OP_TIER_MIGRATE,
- tasks);
- } else
- ret = _add_task_to_dict(rsp_dict, volinfo, volinfo->rebal.op,
- tasks);
+ ret = _add_task_to_dict(rsp_dict, volinfo, volinfo->rebal.op, tasks);
if (ret) {
gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
@@ -3518,15 +3368,12 @@ glusterd_aggregate_task_status(dict_t *rsp_dict, glusterd_volinfo_t *volinfo)
}
tasks++;
}
-done:
ret = dict_set_int32n(rsp_dict, "tasks", SLEN("tasks"), tasks);
if (ret) {
gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
"Error setting tasks count in dict");
goto out;
}
- ret = 0;
-
out:
return ret;
}
@@ -3538,7 +3385,6 @@ glusterd_op_status_volume(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
int node_count = 0;
int brick_index = -1;
int other_count = 0;
- int hot_brick_count = -1;
int other_index = 0;
uint32_t cmd = 0;
char *volname = NULL;
@@ -3628,12 +3474,6 @@ glusterd_op_status_volume(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
goto out;
other_count++;
node_count++;
- } else if ((cmd & GF_CLI_STATUS_TIERD) != 0) {
- ret = glusterd_add_tierd_to_dict(volinfo, rsp_dict, other_index);
- if (ret)
- goto out;
- other_count++;
- node_count++;
} else if ((cmd & GF_CLI_STATUS_SNAPD) != 0) {
ret = glusterd_add_snapd_to_dict(volinfo, rsp_dict, other_index);
if (ret)
@@ -3705,16 +3545,6 @@ glusterd_op_status_volume(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
node_count++;
}
- if (glusterd_is_tierd_enabled(volinfo)) {
- ret = glusterd_add_tierd_to_dict(volinfo, rsp_dict,
- other_index);
- if (ret)
- goto out;
- other_count++;
- other_index++;
- node_count++;
- }
-
if (glusterd_is_shd_compatible_volume(volinfo)) {
if (shd_enabled) {
ret = glusterd_add_shd_to_dict(volinfo, rsp_dict,
@@ -3767,13 +3597,6 @@ glusterd_op_status_volume(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
}
}
- if (volinfo->type == GF_CLUSTER_TYPE_TIER)
- hot_brick_count = volinfo->tier_info.hot_brick_count;
- ret = dict_set_int32n(rsp_dict, "hot_brick_count", SLEN("hot_brick_count"),
- hot_brick_count);
- if (ret)
- goto out;
-
ret = dict_set_int32n(rsp_dict, "type", SLEN("type"), volinfo->type);
if (ret)
goto out;
@@ -4423,9 +4246,7 @@ glusterd_op_build_payload(dict_t **req, char **op_errstr, dict_t *op_ctx)
req_dict = dict_ref(dict);
} break;
- case GD_OP_REMOVE_BRICK:
- case GD_OP_DETACH_TIER_STATUS:
- case GD_OP_REMOVE_TIER_BRICK: {
+ case GD_OP_REMOVE_BRICK: {
dict_t *dict = ctx;
ret = dict_get_strn(dict, "volname", SLEN("volname"), &volname);
if (ret) {
@@ -4477,8 +4298,6 @@ glusterd_op_build_payload(dict_t **req, char **op_errstr, dict_t *op_ctx)
case GD_OP_DEFRAG_BRICK_VOLUME:
case GD_OP_BARRIER:
case GD_OP_BITROT:
- case GD_OP_TIER_START_STOP:
- case GD_OP_TIER_STATUS:
case GD_OP_SCRUB_STATUS:
case GD_OP_SCRUB_ONDEMAND:
case GD_OP_RESET_BRICK: {
@@ -5042,9 +4861,6 @@ glusterd_op_modify_op_ctx(glusterd_op_t op, void *ctx)
* same
*/
case GD_OP_DEFRAG_BRICK_VOLUME:
- case GD_OP_TIER_STATUS:
- case GD_OP_REMOVE_TIER_BRICK:
- case GD_OP_DETACH_TIER_STATUS:
case GD_OP_SCRUB_STATUS:
case GD_OP_SCRUB_ONDEMAND:
ret = dict_get_int32n(op_ctx, "count", SLEN("count"), &count);
@@ -5730,8 +5546,6 @@ glusterd_need_brick_op(glusterd_op_t op)
switch (op) {
case GD_OP_PROFILE_VOLUME:
case GD_OP_STATUS_VOLUME:
- case GD_OP_TIER_STATUS:
- case GD_OP_DETACH_TIER_STATUS:
case GD_OP_DEFRAG_BRICK_VOLUME:
case GD_OP_HEAL_VOLUME:
case GD_OP_SCRUB_STATUS:
@@ -6259,9 +6073,6 @@ glusterd_bricks_select_remove_brick(dict_t *dict, char **op_errstr,
goto out;
}
- if (command == GF_DEFRAG_CMD_DETACH_START)
- return glusterd_bricks_select_tier_volume(dict, op_errstr, selected);
-
ret = dict_get_int32n(dict, "force", SLEN("force"), &force);
if (ret) {
gf_msg(THIS->name, GF_LOG_INFO, 0, GD_MSG_DICT_GET_FAILED,
@@ -6914,7 +6725,6 @@ glusterd_bricks_select_heal_volume(dict_t *dict, char **op_errstr,
char *volname = NULL;
glusterd_conf_t *priv = NULL;
glusterd_volinfo_t *volinfo = NULL;
- glusterd_volinfo_t *dup_volinfo = NULL;
xlator_t *this = NULL;
char msg[2048] = {
0,
@@ -6952,31 +6762,10 @@ glusterd_bricks_select_heal_volume(dict_t *dict, char **op_errstr,
"heal op invalid");
goto out;
}
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- ret = glusterd_create_sub_tier_volinfo(volinfo, &dup_volinfo, _gf_false,
- volname);
- if (ret < 0)
- goto out;
-
- ret = glusterd_shd_select_brick_xlator(
- dict, heal_op, dup_volinfo, &index, &hxlator_count, rsp_dict);
- glusterd_volinfo_delete(dup_volinfo);
- if (ret < 0)
- goto out;
- ret = glusterd_create_sub_tier_volinfo(volinfo, &dup_volinfo, _gf_true,
- volname);
- if (ret < 0)
- goto out;
- ret = glusterd_shd_select_brick_xlator(
- dict, heal_op, dup_volinfo, &index, &hxlator_count, rsp_dict);
- glusterd_volinfo_delete(dup_volinfo);
- if (ret < 0)
- goto out;
- } else {
- ret = glusterd_shd_select_brick_xlator(dict, heal_op, volinfo, &index,
- &hxlator_count, rsp_dict);
- if (ret < 0)
- goto out;
+ ret = glusterd_shd_select_brick_xlator(dict, heal_op, volinfo, &index,
+ &hxlator_count, rsp_dict);
+ if (ret < 0) {
+ goto out;
}
if (!hxlator_count)
@@ -7010,68 +6799,6 @@ out:
}
int
-glusterd_bricks_select_tier_volume(dict_t *dict, char **op_errstr,
- struct cds_list_head *selected)
-{
- int ret = -1;
- char *volname = NULL;
- glusterd_volinfo_t *volinfo = NULL;
- xlator_t *this = NULL;
- char msg[2048] = {
- 0,
- };
- glusterd_pending_node_t *pending_node = NULL;
- glusterd_brickinfo_t *brick = NULL;
- gf_boolean_t retval = _gf_false;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO(THIS->name, this, out);
-
- ret = dict_get_strn(dict, "volname", SLEN("volname"), &volname);
- if (ret) {
- gf_msg("glusterd", GF_LOG_ERROR, 0, GD_MSG_DICT_GET_FAILED,
- "volume name get failed");
- goto out;
- }
-
- ret = glusterd_volinfo_find(volname, &volinfo);
- if (ret) {
- snprintf(msg, sizeof(msg), "Volume %s does not exist", volname);
-
- *op_errstr = gf_strdup(msg);
- gf_msg("glusterd", GF_LOG_ERROR, 0, GD_MSG_VOL_NOT_FOUND, "%s", msg);
- goto out;
- }
- /*check if this node needs tierd*/
- cds_list_for_each_entry(brick, &volinfo->bricks, brick_list)
- {
- if (gf_uuid_compare(MY_UUID, brick->uuid) == 0) {
- retval = _gf_true;
- break;
- }
- }
-
- if (!retval)
- goto out;
-
- pending_node = GF_CALLOC(1, sizeof(*pending_node),
- gf_gld_mt_pending_node_t);
- if (!pending_node) {
- ret = -1;
- goto out;
- } else {
- pending_node->node = volinfo;
- pending_node->type = GD_NODE_TIERD;
- cds_list_add_tail(&pending_node->list, selected);
- pending_node = NULL;
- }
- ret = 0;
-
-out:
- return ret;
-}
-
-int
glusterd_bricks_select_rebalance_volume(dict_t *dict, char **op_errstr,
struct cds_list_head *selected)
{
@@ -7161,7 +6888,6 @@ glusterd_bricks_select_status_volume(dict_t *dict, char **op_errstr,
case GF_CLI_STATUS_SHD:
case GF_CLI_STATUS_QUOTAD:
case GF_CLI_STATUS_SNAPD:
- case GF_CLI_STATUS_TIERD:
case GF_CLI_STATUS_BITD:
case GF_CLI_STATUS_SCRUB:
case GF_CLI_STATUS_CLIENT_LIST:
@@ -7307,30 +7033,6 @@ glusterd_bricks_select_status_volume(dict_t *dict, char **op_errstr,
cds_list_add_tail(&pending_node->list, selected);
ret = 0;
- } else if ((cmd & GF_CLI_STATUS_TIERD) != 0) {
- if (!volinfo->tierd.svc.online) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_TIERD_NOT_RUNNING,
- "tierd is not "
- "running");
- ret = -1;
- goto out;
- }
- pending_node = GF_CALLOC(1, sizeof(*pending_node),
- gf_gld_mt_pending_node_t);
- if (!pending_node) {
- gf_msg(this->name, GF_LOG_ERROR, ENOMEM, GD_MSG_NO_MEMORY,
- "failed to allocate "
- "memory for pending node");
- ret = -1;
- goto out;
- }
-
- pending_node->node = (void *)(&volinfo->tierd);
- pending_node->type = GD_NODE_TIERD;
- pending_node->index = 0;
- cds_list_add_tail(&pending_node->list, selected);
-
- ret = 0;
} else if ((cmd & GF_CLI_STATUS_SNAPD) != 0) {
if (!volinfo->snapd.svc.online) {
gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_SNAPD_NOT_RUNNING,
@@ -7650,11 +7352,6 @@ glusterd_op_bricks_select(glusterd_op_t op, dict_t *dict, char **op_errstr,
ret = glusterd_bricks_select_status_volume(dict, op_errstr,
selected);
break;
- case GD_OP_TIER_STATUS:
- ret = glusterd_bricks_select_tier_volume(dict, op_errstr, selected);
- break;
-
- case GD_OP_DETACH_TIER_STATUS:
case GD_OP_DEFRAG_BRICK_VOLUME:
ret = glusterd_bricks_select_rebalance_volume(dict, op_errstr,
selected);
@@ -8257,13 +7954,11 @@ glusterd_op_free_ctx(glusterd_op_t op, void *ctx)
case GD_OP_PROFILE_VOLUME:
case GD_OP_STATUS_VOLUME:
case GD_OP_REBALANCE:
- case GD_OP_TIER_START_STOP:
case GD_OP_HEAL_VOLUME:
case GD_OP_STATEDUMP_VOLUME:
case GD_OP_CLEARLOCKS_VOLUME:
case GD_OP_DEFRAG_BRICK_VOLUME:
case GD_OP_MAX_OPVERSION:
- case GD_OP_TIER_STATUS:
dict_unref(ctx);
break;
default:
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.h b/xlators/mgmt/glusterd/src/glusterd-op-sm.h
index 47c3ac44515..8a24b16612a 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.h
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.h
@@ -259,9 +259,6 @@ glusterd_op_init_commit_rsp_dict(glusterd_op_t op);
void
glusterd_op_modify_op_ctx(glusterd_op_t op, void *op_ctx);
-void
-glusterd_op_perform_detach_tier(glusterd_volinfo_t *volinfo);
-
int
glusterd_set_detach_bricks(dict_t *dict, glusterd_volinfo_t *volinfo);
@@ -305,9 +302,6 @@ glusterd_set_opinfo(char *errstr, int32_t op_errno, int32_t op_ret);
int
glusterd_dict_set_volid(dict_t *dict, char *volname, char **op_errstr);
-int32_t
-glusterd_tier_op(xlator_t *this, void *data);
-
int
glusterd_op_stats_volume(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index 5562ebbda37..74105a60df5 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -249,8 +249,7 @@ glusterd_handle_defrag_start(glusterd_volinfo_t *volinfo, char *op_errstr,
GLUSTERD_GET_DEFRAG_SOCK_FILE(sockfile, volinfo);
GLUSTERD_GET_DEFRAG_PID_FILE(pidfile, volinfo, priv);
snprintf(logfile, PATH_MAX, "%s/%s-%s.log", DEFAULT_LOG_FILE_DIRECTORY,
- volinfo->volname,
- (cmd == GF_DEFRAG_CMD_START_TIER ? "tier" : "rebalance"));
+ volinfo->volname, "rebalance");
runinit(&runner);
if (this->ctx->cmd_args.valgrind) {
@@ -273,8 +272,7 @@ glusterd_handle_defrag_start(glusterd_volinfo_t *volinfo, char *op_errstr,
GLUSTERD_GET_DEFRAG_SOCK_FILE_OLD(sockfile, volinfo, priv);
snprintf(logfile, PATH_MAX, "%s/%s-%s-%s.log",
- DEFAULT_LOG_FILE_DIRECTORY, volinfo->volname,
- (cmd == GF_DEFRAG_CMD_START_TIER ? "tier" : "rebalance"),
+ DEFAULT_LOG_FILE_DIRECTORY, volinfo->volname, "rebalance",
uuid_utoa(MY_UUID));
} else {
@@ -288,11 +286,6 @@ glusterd_handle_defrag_start(glusterd_volinfo_t *volinfo, char *op_errstr,
"*dht.assert-no-child-down=yes", "--xlator-option",
"*dht.readdir-optimize=on", "--process-name", "rebalance", NULL);
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- runner_add_arg(&runner, "--xlator-option");
- runner_argprintf(&runner, "*tier-dht.xattr-name=trusted.tier.tier-dht");
- }
-
runner_add_arg(&runner, "--xlator-option");
runner_argprintf(&runner, "*dht.rebalance-cmd=%d", cmd);
runner_add_arg(&runner, "--xlator-option");
@@ -486,18 +479,6 @@ glusterd_rebalance_cmd_validate(int cmd, char *volname,
goto out;
}
- ret = glusterd_disallow_op_for_tier(*volinfo, GD_OP_REBALANCE, cmd);
- if (ret) {
- gf_msg("glusterd", GF_LOG_ERROR, 0, GD_MSG_REBALANCE_CMD_IN_TIER_VOL,
- "Received rebalance command "
- "on Tier volume %s",
- volname);
- snprintf(op_errstr, len,
- "Rebalance operations are not "
- "supported on a tiered volume");
- goto out;
- }
-
ret = 0;
out:
@@ -572,9 +553,7 @@ __glusterd_handle_defrag_volume(rpcsvc_request_t *req)
if (ret)
goto out;
- if ((cmd == GF_DEFRAG_CMD_STATUS) || (cmd == GF_DEFRAG_CMD_STATUS_TIER) ||
- (cmd == GF_DEFRAG_CMD_STOP_DETACH_TIER) ||
- (cmd == GF_DEFRAG_CMD_STOP) || (cmd == GF_DEFRAG_CMD_DETACH_STATUS)) {
+ if ((cmd == GF_DEFRAG_CMD_STATUS) || (cmd == GF_DEFRAG_CMD_STOP)) {
op = GD_OP_DEFRAG_BRICK_VOLUME;
} else
op = GD_OP_REBALANCE;
@@ -686,8 +665,7 @@ glusterd_set_rebalance_id_in_rsp_dict(dict_t *req_dict, dict_t *rsp_dict)
* here. So that cli can display the rebalance id.*/
if ((cmd == GF_DEFRAG_CMD_START) ||
(cmd == GF_DEFRAG_CMD_START_LAYOUT_FIX) ||
- (cmd == GF_DEFRAG_CMD_START_FORCE) ||
- (cmd == GF_DEFRAG_CMD_START_TIER)) {
+ (cmd == GF_DEFRAG_CMD_START_FORCE)) {
if (is_origin_glusterd(rsp_dict)) {
ret = dict_get_strn(req_dict, GF_REBALANCE_TID_KEY,
SLEN(GF_REBALANCE_TID_KEY), &task_id_str);
@@ -715,8 +693,7 @@ glusterd_set_rebalance_id_in_rsp_dict(dict_t *req_dict, dict_t *rsp_dict)
/* Set task-id, if available, in rsp_dict for operations other than
* start. This is needed when we want rebalance id in xml output
*/
- if (cmd == GF_DEFRAG_CMD_STATUS || cmd == GF_DEFRAG_CMD_STOP ||
- cmd == GF_DEFRAG_CMD_STATUS_TIER) {
+ if (cmd == GF_DEFRAG_CMD_STATUS || cmd == GF_DEFRAG_CMD_STOP) {
if (!gf_uuid_is_null(volinfo->rebal.rebalance_id)) {
if (GD_OP_REMOVE_BRICK == volinfo->rebal.op)
ret = glusterd_copy_uuid_to_dict(
@@ -748,7 +725,6 @@ glusterd_mgmt_v3_op_stage_rebalance(dict_t *dict, char **op_errstr)
glusterd_volinfo_t *volinfo = NULL;
char *task_id_str = NULL;
xlator_t *this = 0;
- int32_t is_force = 0;
this = THIS;
GF_ASSERT(this);
@@ -773,28 +749,6 @@ glusterd_mgmt_v3_op_stage_rebalance(dict_t *dict, char **op_errstr)
goto out;
}
switch (cmd) {
- case GF_DEFRAG_CMD_START_TIER:
- ret = dict_get_int32n(dict, "force", SLEN("force"), &is_force);
- if (ret)
- is_force = 0;
-
- if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
- gf_asprintf(op_errstr,
- "volume %s is not a tier "
- "volume.",
- volinfo->volname);
- ret = -1;
- goto out;
- }
- if ((!is_force) && glusterd_is_tier_daemon_running(volinfo)) {
- ret = gf_asprintf(op_errstr,
- "A Tier daemon is "
- "already running on volume %s",
- volname);
- ret = -1;
- goto out;
- }
- /* Fall through */
case GF_DEFRAG_CMD_START:
case GF_DEFRAG_CMD_START_LAYOUT_FIX:
/* Check if the connected clients are all of version
@@ -847,7 +801,6 @@ glusterd_mgmt_v3_op_stage_rebalance(dict_t *dict, char **op_errstr)
goto out;
}
break;
- case GF_DEFRAG_CMD_STATUS_TIER:
case GF_DEFRAG_CMD_STATUS:
case GF_DEFRAG_CMD_STOP:
@@ -892,38 +845,8 @@ glusterd_mgmt_v3_op_stage_rebalance(dict_t *dict, char **op_errstr)
goto out;
}
}
- if (cmd == GF_DEFRAG_CMD_STATUS_TIER) {
- if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
- snprintf(msg, sizeof(msg),
- "volume %s is not "
- "a tier volume.",
- volinfo->volname);
- ret = -1;
- goto out;
- }
- }
-
break;
- case GF_DEFRAG_CMD_STOP_DETACH_TIER:
- case GF_DEFRAG_CMD_DETACH_STATUS:
- if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
- snprintf(msg, sizeof(msg),
- "volume %s is not "
- "a tier volume.",
- volinfo->volname);
- ret = -1;
- goto out;
- }
-
- if (volinfo->rebal.op != GD_OP_REMOVE_BRICK) {
- snprintf(msg, sizeof(msg),
- "Detach-tier "
- "not started");
- ret = -1;
- goto out;
- }
- break;
default:
break;
}
@@ -979,7 +902,6 @@ glusterd_mgmt_v3_op_rebalance(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
case GF_DEFRAG_CMD_START:
case GF_DEFRAG_CMD_START_LAYOUT_FIX:
case GF_DEFRAG_CMD_START_FORCE:
- case GF_DEFRAG_CMD_START_TIER:
ret = dict_get_int32n(dict, "force", SLEN("force"), &is_force);
if (ret)
@@ -1048,7 +970,6 @@ glusterd_mgmt_v3_op_rebalance(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
break;
}
case GF_DEFRAG_CMD_STOP:
- case GF_DEFRAG_CMD_STOP_DETACH_TIER:
/* Clear task-id only on explicitly stopping rebalance.
* Also clear the stored operation, so it doesn't cause trouble
* with future rebalance/remove-brick starts
@@ -1086,20 +1007,10 @@ glusterd_mgmt_v3_op_rebalance(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
goto out;
}
- if (volinfo->type == GF_CLUSTER_TYPE_TIER &&
- cmd == GF_OP_CMD_STOP_DETACH_TIER) {
- glusterd_defrag_info_set(volinfo, dict,
- GF_DEFRAG_CMD_START_TIER,
- GF_DEFRAG_CMD_START, GD_OP_REBALANCE);
- glusterd_restart_rebalance_for_volume(volinfo);
- }
-
ret = 0;
break;
- case GF_DEFRAG_CMD_START_DETACH_TIER:
case GF_DEFRAG_CMD_STATUS:
- case GF_DEFRAG_CMD_STATUS_TIER:
break;
default:
break;
@@ -1124,7 +1035,6 @@ glusterd_op_stage_rebalance(dict_t *dict, char **op_errstr)
char *task_id_str = NULL;
dict_t *op_ctx = NULL;
xlator_t *this = 0;
- int32_t is_force = 0;
this = THIS;
GF_ASSERT(this);
@@ -1149,28 +1059,6 @@ glusterd_op_stage_rebalance(dict_t *dict, char **op_errstr)
goto out;
}
switch (cmd) {
- case GF_DEFRAG_CMD_START_TIER:
- ret = dict_get_int32n(dict, "force", SLEN("force"), &is_force);
- if (ret)
- is_force = 0;
-
- if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
- gf_asprintf(op_errstr,
- "volume %s is not a tier "
- "volume.",
- volinfo->volname);
- ret = -1;
- goto out;
- }
- if ((!is_force) && glusterd_is_tier_daemon_running(volinfo)) {
- ret = gf_asprintf(op_errstr,
- "A Tier daemon is "
- "already running on volume %s",
- volname);
- ret = -1;
- goto out;
- }
- /* Fall through */
case GF_DEFRAG_CMD_START:
case GF_DEFRAG_CMD_START_LAYOUT_FIX:
/* Check if the connected clients are all of version
@@ -1231,7 +1119,6 @@ glusterd_op_stage_rebalance(dict_t *dict, char **op_errstr)
goto out;
}
break;
- case GF_DEFRAG_CMD_STATUS_TIER:
case GF_DEFRAG_CMD_STATUS:
case GF_DEFRAG_CMD_STOP:
@@ -1276,38 +1163,8 @@ glusterd_op_stage_rebalance(dict_t *dict, char **op_errstr)
goto out;
}
}
- if (cmd == GF_DEFRAG_CMD_STATUS_TIER) {
- if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
- snprintf(msg, sizeof(msg),
- "volume %s is not "
- "a tier volume.",
- volinfo->volname);
- ret = -1;
- goto out;
- }
- }
-
break;
- case GF_DEFRAG_CMD_STOP_DETACH_TIER:
- case GF_DEFRAG_CMD_DETACH_STATUS:
- if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
- snprintf(msg, sizeof(msg),
- "volume %s is not "
- "a tier volume.",
- volinfo->volname);
- ret = -1;
- goto out;
- }
-
- if (volinfo->rebal.op != GD_OP_REMOVE_BRICK) {
- snprintf(msg, sizeof(msg),
- "Detach-tier "
- "not started");
- ret = -1;
- goto out;
- }
- break;
default:
break;
}
@@ -1363,8 +1220,7 @@ glusterd_op_rebalance(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
/* Set task-id, if available, in op_ctx dict for operations other than
* start
*/
- if (cmd == GF_DEFRAG_CMD_STATUS || cmd == GF_DEFRAG_CMD_STOP ||
- cmd == GF_DEFRAG_CMD_STATUS_TIER) {
+ if (cmd == GF_DEFRAG_CMD_STATUS || cmd == GF_DEFRAG_CMD_STOP) {
if (!gf_uuid_is_null(volinfo->rebal.rebalance_id)) {
ctx = glusterd_op_get_ctx();
if (!ctx) {
@@ -1394,7 +1250,6 @@ glusterd_op_rebalance(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
case GF_DEFRAG_CMD_START:
case GF_DEFRAG_CMD_START_LAYOUT_FIX:
case GF_DEFRAG_CMD_START_FORCE:
- case GF_DEFRAG_CMD_START_TIER:
ret = dict_get_int32n(dict, "force", SLEN("force"), &is_force);
if (ret)
@@ -1463,7 +1318,6 @@ glusterd_op_rebalance(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
break;
}
case GF_DEFRAG_CMD_STOP:
- case GF_DEFRAG_CMD_STOP_DETACH_TIER:
/* Clear task-id only on explicitly stopping rebalance.
* Also clear the stored operation, so it doesn't cause trouble
* with future rebalance/remove-brick starts
@@ -1501,20 +1355,10 @@ glusterd_op_rebalance(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
goto out;
}
- if (volinfo->type == GF_CLUSTER_TYPE_TIER &&
- cmd == GF_OP_CMD_STOP_DETACH_TIER) {
- glusterd_defrag_info_set(volinfo, dict,
- GF_DEFRAG_CMD_START_TIER,
- GF_DEFRAG_CMD_START, GD_OP_REBALANCE);
- glusterd_restart_rebalance_for_volume(volinfo);
- }
-
ret = 0;
break;
- case GF_DEFRAG_CMD_START_DETACH_TIER:
case GF_DEFRAG_CMD_STATUS:
- case GF_DEFRAG_CMD_STATUS_TIER:
break;
default:
break;
@@ -1552,23 +1396,11 @@ glusterd_defrag_event_notify_handle(dict_t *dict)
volname_ptr = strchr(volname_ptr, '/');
volname = volname_ptr + 1;
} else {
- volname_ptr = strstr(volname, "tierd/");
- if (volname_ptr) {
- volname_ptr = strchr(volname_ptr, '/');
- if (!volname_ptr) {
- ret = -1;
- goto out;
- }
- volname = volname_ptr + 1;
- } else {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- GD_MSG_NO_REBALANCE_PFX_IN_VOLNAME,
- "volname received (%s) is not prefixed with "
- "rebalance or tierd.",
- volname);
- ret = -1;
- goto out;
- }
+ gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_NO_REBALANCE_PFX_IN_VOLNAME,
+ "volname received (%s) is not prefixed with rebalance.",
+ volname);
+ ret = -1;
+ goto out;
}
ret = glusterd_volinfo_find(volname, &volinfo);
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
index 728781d4940..a6c157e6abb 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
@@ -58,8 +58,6 @@ glusterd_op_send_cli_response(glusterd_op_t op, int32_t op_ret,
ctx = op_ctx;
switch (op) {
- case GD_OP_DETACH_TIER:
- case GD_OP_REMOVE_TIER_BRICK:
case GD_OP_REMOVE_BRICK: {
if (ctx)
ret = dict_get_strn(ctx, "errstr", SLEN("errstr"), &errstr);
@@ -70,9 +68,6 @@ glusterd_op_send_cli_response(glusterd_op_t op, int32_t op_ret,
errstr = "Error while resetting options";
break;
}
- case GD_OP_TIER_MIGRATE:
- case GD_OP_TIER_STATUS:
- case GD_OP_DETACH_TIER_STATUS:
case GD_OP_REBALANCE:
case GD_OP_DEFRAG_BRICK_VOLUME: {
if (ctx) {
@@ -138,9 +133,14 @@ glusterd_op_send_cli_response(glusterd_op_t op, int32_t op_ret,
case GD_OP_SCRUB_ONDEMAND:
case GD_OP_RESET_BRICK:
case GD_OP_MAX_OPVERSION:
- case GD_OP_TIER_START_STOP:
case GD_OP_DETACH_NOT_STARTED:
case GD_OP_GANESHA:
+ case GD_OP_DETACH_TIER:
+ case GD_OP_TIER_MIGRATE:
+ case GD_OP_TIER_START_STOP:
+ case GD_OP_TIER_STATUS:
+ case GD_OP_DETACH_TIER_STATUS:
+ case GD_OP_REMOVE_TIER_BRICK:
case GD_OP_ADD_TIER_BRICK:
{
@@ -2279,8 +2279,7 @@ glusterd_brick_op(call_frame_t *frame, xlator_t *this, void *data)
rpc = glusterd_pending_node_get_rpc(pending_node);
if (!rpc) {
- if (pending_node->type == GD_NODE_REBALANCE ||
- pending_node->type == GD_NODE_TIERD) {
+ if (pending_node->type == GD_NODE_REBALANCE) {
opinfo.brick_pending_count = 0;
ret = 0;
GF_FREE(req->input.input_val);
diff --git a/xlators/mgmt/glusterd/src/glusterd-sm.c b/xlators/mgmt/glusterd/src/glusterd-sm.c
index 6f916b634c1..bb9b5cbf300 100644
--- a/xlators/mgmt/glusterd/src/glusterd-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-sm.c
@@ -738,16 +738,6 @@ glusterd_peer_detach_cleanup(glusterd_conf_t *priv)
}
}
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- svc = &(volinfo->tierd.svc);
- ret = svc->stop(svc, SIGTERM);
- if (ret) {
- gf_msg(THIS->name, GF_LOG_ERROR, 0, GD_MSG_SVC_STOP_FAIL,
- "Failed "
- "to stop tierd daemon service");
- }
- }
-
if (glusterd_is_shd_compatible_volume(volinfo)) {
svc = &(volinfo->shd.svc);
ret = svc->stop(svc, SIGTERM);
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index abbcb6288f4..ec630d55469 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -1905,133 +1905,6 @@ out:
}
int
-glusterd_snapshot_pause_tier(xlator_t *this, glusterd_volinfo_t *volinfo)
-{
- int ret = -1;
- dict_t *dict = NULL;
- char *op_errstr = NULL;
-
- GF_VALIDATE_OR_GOTO("glusterd", this, out);
- GF_VALIDATE_OR_GOTO(this->name, volinfo, out);
-
- if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
- ret = 0;
- goto out;
- }
-
- dict = dict_new();
- if (!dict) {
- goto out;
- }
-
- ret = dict_set_int32n(dict, "rebalance-command", SLEN("rebalance-command"),
- GF_DEFRAG_CMD_PAUSE_TIER);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
- "Failed to set rebalance-command");
- goto out;
- }
-
- ret = dict_set_strn(dict, "volname", SLEN("volname"), volinfo->volname);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
- "Failed to set volname");
- goto out;
- }
-
- ret = gd_brick_op_phase(GD_OP_DEFRAG_BRICK_VOLUME, NULL, dict, &op_errstr);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_SNAP_PAUSE_TIER_FAIL,
- "Failed to pause tier. Errstr=%s", op_errstr);
- goto out;
- }
-
-out:
- if (dict)
- dict_unref(dict);
-
- return ret;
-}
-
-int
-glusterd_snapshot_resume_tier(xlator_t *this, dict_t *snap_dict)
-{
- int ret = -1;
- dict_t *dict = NULL;
- int64_t volcount = 0;
- char key[64] = "";
- int keylen;
- char *volname = NULL;
- int i = 0;
- char *op_errstr = NULL;
- glusterd_volinfo_t *volinfo = NULL;
-
- GF_VALIDATE_OR_GOTO("glusterd", this, out);
- GF_VALIDATE_OR_GOTO(this->name, snap_dict, out);
-
- ret = dict_get_int64(snap_dict, "volcount", &volcount);
- if (ret) {
- goto out;
- }
- if (volcount <= 0) {
- ret = -1;
- goto out;
- }
-
- dict = dict_new();
- if (!dict)
- goto out;
-
- for (i = 1; i <= volcount; i++) {
- keylen = snprintf(key, sizeof(key), "volname%d", i);
- ret = dict_get_strn(snap_dict, key, keylen, &volname);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
- "Failed to get key %s", volname);
- goto out;
- }
-
- ret = glusterd_volinfo_find(volname, &volinfo);
- if (ret)
- goto out;
-
- if (volinfo->type != GF_CLUSTER_TYPE_TIER)
- continue;
-
- ret = dict_set_int32n(dict, "rebalance-command",
- SLEN("rebalance-command"),
- GF_DEFRAG_CMD_RESUME_TIER);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
- "Failed to set rebalance-command");
-
- goto out;
- }
-
- ret = dict_set_strn(dict, "volname", SLEN("volname"), volname);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
- "Failed to set volname");
- goto out;
- }
-
- ret = gd_brick_op_phase(GD_OP_DEFRAG_BRICK_VOLUME, NULL, dict,
- &op_errstr);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_SNAP_RESUME_TIER_FAIL,
- "Failed to resume tier");
- goto out;
- }
- }
-
-out:
- if (dict)
- dict_unref(dict);
-
- return ret;
-}
-
-int
glusterd_snap_create_clone_common_prevalidate(
dict_t *rsp_dict, int flags, char *snapname, char *err_str,
char *snap_volname, int64_t volcount, glusterd_volinfo_t *volinfo,
@@ -2525,13 +2398,6 @@ glusterd_snapshot_create_prevalidate(dict_t *dict, char **op_errstr,
"Failed to pre validate");
goto out;
}
-
- ret = glusterd_snapshot_pause_tier(this, volinfo);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_SNAP_PAUSE_TIER_FAIL,
- "Failed to pause tier in snap prevalidate.");
- goto out;
- }
}
ret = dict_set_int64(rsp_dict, "volcount", volcount);
@@ -8323,12 +8189,6 @@ glusterd_snapshot_create_postvalidate(dict_t *dict, int32_t op_ret,
}
}
- ret = glusterd_snapshot_resume_tier(this, dict);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_SNAP_RESUME_TIER_FAIL,
- "Failed to resume tier in snapshot postvalidate.");
- }
-
out:
return ret;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index b573b6610fb..038355dcf32 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -845,62 +845,6 @@ out:
return ret;
}
-int32_t
-glusterd_volume_write_tier_details(int fd, glusterd_volinfo_t *volinfo)
-{
- int32_t ret = -1;
- char buf[PATH_MAX] = "";
-
- if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
- ret = 0;
- goto out;
- }
-
- snprintf(buf, sizeof(buf), "%d", volinfo->tier_info.cold_brick_count);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_COLD_COUNT, buf);
- if (ret)
- goto out;
-
- snprintf(buf, sizeof(buf), "%d", volinfo->tier_info.cold_replica_count);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_COLD_REPLICA_COUNT, buf);
- if (ret)
- goto out;
-
- snprintf(buf, sizeof(buf), "%d", volinfo->tier_info.cold_disperse_count);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_COLD_DISPERSE_COUNT, buf);
- if (ret)
- goto out;
-
- snprintf(buf, sizeof(buf), "%d", volinfo->tier_info.cold_redundancy_count);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_COLD_REDUNDANCY_COUNT,
- buf);
- if (ret)
- goto out;
-
- snprintf(buf, sizeof(buf), "%d", volinfo->tier_info.hot_brick_count);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_HOT_COUNT, buf);
- if (ret)
- goto out;
-
- snprintf(buf, sizeof(buf), "%d", volinfo->tier_info.hot_replica_count);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_HOT_REPLICA_COUNT, buf);
- if (ret)
- goto out;
-
- snprintf(buf, sizeof(buf), "%d", volinfo->tier_info.hot_type);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_HOT_TYPE, buf);
- if (ret)
- goto out;
-
- snprintf(buf, sizeof(buf), "%d", volinfo->tier_info.cold_type);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_COLD_TYPE, buf);
- if (ret)
- goto out;
-
-out:
- return ret;
-}
-
static int32_t
glusterd_volume_exclude_options_write(int fd, glusterd_volinfo_t *volinfo)
{
@@ -1017,23 +961,11 @@ glusterd_volume_exclude_options_write(int fd, glusterd_volinfo_t *volinfo)
}
total_len += ret;
}
- if (conf->op_version >= GD_OP_VERSION_3_10_0) {
- ret = snprintf(buf + total_len, sizeof(buf) - total_len, "%s=%d\n",
- GF_TIER_ENABLED, volinfo->is_tier_enabled);
- if (ret < 0 || ret >= sizeof(buf) - total_len) {
- ret = -1;
- goto out;
- }
- }
ret = gf_store_save_items(fd, buf);
if (ret)
goto out;
- ret = glusterd_volume_write_tier_details(fd, volinfo);
- if (ret)
- goto out;
-
ret = glusterd_volume_write_snap_details(fd, volinfo);
out:
@@ -1387,83 +1319,6 @@ _gd_store_rebalance_dict(dict_t *dict, char *key, data_t *value, void *data)
}
int32_t
-glusterd_store_state_tier_write(int fd, glusterd_volinfo_t *volinfo)
-{
- int ret = -1;
- char buf[PATH_MAX] = {
- 0,
- };
-
- GF_VALIDATE_OR_GOTO(THIS->name, (fd > 0), out);
- GF_VALIDATE_OR_GOTO(THIS->name, volinfo, out);
-
- /*tier counter values are stored here. so that after restart
- * of glusterd tier resumes at the state is was brought down
- */
-
- if (volinfo->tier.defrag_cmd == GF_DEFRAG_CMD_STATUS) {
- ret = 0;
- goto out;
- }
-
- snprintf(buf, sizeof(buf), "%d", volinfo->tier.defrag_status);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_VOL_TIER_STATUS, buf);
- if (ret)
- goto out;
-
- snprintf(buf, sizeof(buf), "%d", volinfo->tier.op);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_TIER_DETACH_OP, buf);
- if (ret)
- goto out;
-
- snprintf(buf, sizeof(buf), "%" PRIu64, volinfo->tier.rebalance_files);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_VOL_MIGRATED_FILES, buf);
- if (ret)
- goto out;
-
- snprintf(buf, sizeof(buf), "%" PRIu64, volinfo->tier.rebalance_data);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_VOL_MIGRATED_SIZE, buf);
- if (ret)
- goto out;
-
- snprintf(buf, sizeof(buf), "%" PRIu64, volinfo->tier.lookedup_files);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_VOL_MIGRATIONS_SCANNED,
- buf);
- if (ret)
- goto out;
-
- snprintf(buf, sizeof(buf), "%" PRIu64, volinfo->tier.rebalance_failures);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_VOL_MIGRATIONS_FAILURES,
- buf);
- if (ret)
- goto out;
-
- snprintf(buf, sizeof(buf), "%" PRIu64, volinfo->tier.skipped_files);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_VOL_MIGRATIONS_SKIPPED,
- buf);
- if (ret)
- goto out;
-
- snprintf(buf, sizeof(buf), "%f", volinfo->tier.rebalance_time);
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_VOL_MIGRATION_RUN_TIME,
- buf);
- if (ret)
- goto out;
-
- gf_uuid_unparse(volinfo->tier.rebalance_id, buf);
- ret = gf_store_save_value(fd, GF_TIER_TID_KEY, buf);
- if (ret)
- goto out;
-
- if (volinfo->tier.dict) {
- dict_foreach(volinfo->tier.dict, _gd_store_rebalance_dict, &fd);
- }
-out:
- gf_msg_debug(THIS->name, 0, "Returning %d", ret);
- return ret;
-}
-
-static int32_t
glusterd_store_node_state_write(int fd, glusterd_volinfo_t *volinfo)
{
int ret = -1;
@@ -1537,12 +1392,6 @@ glusterd_store_perform_node_state_store(glusterd_volinfo_t *volinfo)
if (ret)
goto out;
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- ret = glusterd_store_state_tier_write(fd, volinfo);
- if (ret)
- goto out;
- }
-
ret = gf_store_rename_tmppath(volinfo->node_state_shandle);
if (ret)
goto out;
@@ -2972,36 +2821,6 @@ glusterd_store_retrieve_node_state(glusterd_volinfo_t *volinfo)
} else if (!strncmp(key, GLUSTERD_STORE_KEY_VOL_DEFRAG_RUN_TIME,
SLEN(GLUSTERD_STORE_KEY_VOL_DEFRAG_RUN_TIME))) {
volinfo->rebal.rebalance_time = atoi(value);
-
- /* if none of the above keys match then its related to tier
- * so we get the values and store it on volinfo->tier
- */
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_VOL_TIER_STATUS,
- SLEN(GLUSTERD_STORE_KEY_VOL_TIER_STATUS))) {
- volinfo->tier.defrag_status = atoi(value);
- } else if (!strncmp(key, GF_TIER_TID_KEY, SLEN(GF_TIER_TID_KEY))) {
- gf_uuid_parse(value, volinfo->tier.rebalance_id);
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_TIER_DETACH_OP,
- SLEN(GLUSTERD_STORE_KEY_TIER_DETACH_OP))) {
- volinfo->tier.op = atoi(value);
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_VOL_MIGRATED_FILES,
- SLEN(GLUSTERD_STORE_KEY_VOL_MIGRATED_FILES))) {
- volinfo->tier.rebalance_files = atoi(value);
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_VOL_MIGRATED_SIZE,
- SLEN(GLUSTERD_STORE_KEY_VOL_MIGRATED_SIZE))) {
- volinfo->tier.rebalance_data = atoi(value);
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_VOL_MIGRATIONS_SCANNED,
- SLEN(GLUSTERD_STORE_KEY_VOL_MIGRATIONS_SCANNED))) {
- volinfo->tier.lookedup_files = atoi(value);
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_VOL_MIGRATIONS_FAILURES,
- SLEN(GLUSTERD_STORE_KEY_VOL_MIGRATIONS_FAILURES))) {
- volinfo->tier.rebalance_failures = atoi(value);
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_VOL_MIGRATIONS_SKIPPED,
- SLEN(GLUSTERD_STORE_KEY_VOL_MIGRATIONS_SKIPPED))) {
- volinfo->tier.skipped_files = atoi(value);
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_VOL_MIGRATION_RUN_TIME,
- SLEN(GLUSTERD_STORE_KEY_VOL_MIGRATION_RUN_TIME))) {
- volinfo->tier.rebalance_time = atoi(value);
} else {
if (!tmp_dict) {
tmp_dict = dict_new();
@@ -3035,10 +2854,7 @@ glusterd_store_retrieve_node_state(glusterd_volinfo_t *volinfo)
ret = gf_store_iter_get_next(iter, &key, &value, &op_errno);
}
if (tmp_dict) {
- if (volinfo->type == GF_CLUSTER_TYPE_TIER)
- volinfo->tier.dict = dict_ref(tmp_dict);
- else
- volinfo->rebal.dict = dict_ref(tmp_dict);
+ volinfo->rebal.dict = dict_ref(tmp_dict);
}
if (op_errno != GD_STORE_EOF) {
@@ -3060,8 +2876,6 @@ out:
if (ret) {
if (volinfo->rebal.dict)
dict_unref(volinfo->rebal.dict);
- else if (volinfo->tier.dict)
- dict_unref(volinfo->tier.dict);
}
if (tmp_dict)
dict_unref(tmp_dict);
@@ -3220,28 +3034,6 @@ glusterd_store_update_volinfo(glusterd_volinfo_t *volinfo)
"parent_volname truncated: %s", volinfo->parent_volname);
goto out;
}
- } else if (!strncmp(key, GF_TIER_ENABLED, SLEN(GF_TIER_ENABLED))) {
- volinfo->is_tier_enabled = atoi(value);
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_COLD_COUNT, strlen(key))) {
- volinfo->tier_info.cold_brick_count = atoi(value);
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_COLD_REPLICA_COUNT,
- strlen(key))) {
- volinfo->tier_info.cold_replica_count = atoi(value);
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_COLD_DISPERSE_COUNT,
- strlen(key))) {
- volinfo->tier_info.cold_disperse_count = atoi(value);
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_COLD_REDUNDANCY_COUNT,
- strlen(key))) {
- volinfo->tier_info.cold_redundancy_count = atoi(value);
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_HOT_COUNT, strlen(key))) {
- volinfo->tier_info.hot_brick_count = atoi(value);
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_HOT_REPLICA_COUNT,
- strlen(key))) {
- volinfo->tier_info.hot_replica_count = atoi(value);
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_HOT_TYPE, strlen(key))) {
- volinfo->tier_info.hot_type = atoi(value);
- } else if (!strncmp(key, GLUSTERD_STORE_KEY_COLD_TYPE, strlen(key))) {
- volinfo->tier_info.cold_type = atoi(value);
} else if (!strncmp(key, GLUSTERD_STORE_KEY_VOL_QUOTA_VERSION,
SLEN(GLUSTERD_STORE_KEY_VOL_QUOTA_VERSION))) {
volinfo->quota_xattr_version = atoi(value);
@@ -3317,7 +3109,6 @@ glusterd_store_update_volinfo(glusterd_volinfo_t *volinfo)
GF_ASSERT(volinfo->redundancy_count > 0);
break;
- case GF_CLUSTER_TYPE_TIER:
case GF_CLUSTER_TYPE_STRIPE:
case GF_CLUSTER_TYPE_STRIPE_REPLICATE:
gf_msg(this->name, GF_LOG_CRITICAL, ENOTSUP,
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.h b/xlators/mgmt/glusterd/src/glusterd-store.h
index 8feebfa8a5d..43f971afd59 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.h
+++ b/xlators/mgmt/glusterd/src/glusterd-store.h
@@ -61,17 +61,6 @@ typedef enum glusterd_store_ver_ac_ {
#define GLUSTERD_STORE_KEY_VOL_CLIENT_OP_VERSION "client-op-version"
#define GLUSTERD_STORE_KEY_VOL_QUOTA_VERSION "quota-version"
-#define GLUSTERD_STORE_KEY_VOL_TIER_STATUS "tier_status"
-#define GLUSTERD_STORE_KEY_TIER_DETACH_OP "tier_op"
-#define GLUSTERD_STORE_KEY_COLD_TYPE "cold_type"
-#define GLUSTERD_STORE_KEY_COLD_COUNT "cold_count"
-#define GLUSTERD_STORE_KEY_COLD_REPLICA_COUNT "cold_replica_count"
-#define GLUSTERD_STORE_KEY_COLD_DISPERSE_COUNT "cold_disperse_count"
-#define GLUSTERD_STORE_KEY_COLD_REDUNDANCY_COUNT "cold_redundancy_count"
-#define GLUSTERD_STORE_KEY_HOT_TYPE "hot_type"
-#define GLUSTERD_STORE_KEY_HOT_COUNT "hot_count"
-#define GLUSTERD_STORE_KEY_HOT_REPLICA_COUNT "hot_replica_count"
-
#define GLUSTERD_STORE_KEY_SNAP_NAME "name"
#define GLUSTERD_STORE_KEY_SNAP_ID "snap-id"
#define GLUSTERD_STORE_KEY_SNAP_DESC "desc"
diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
index 5b95a026fbe..97a0d646273 100644
--- a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
+++ b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
@@ -19,8 +19,6 @@
#include "glusterd-quotad-svc.h"
#include "glusterd-nfs-svc.h"
#include "glusterd-bitd-svc.h"
-#include "glusterd-tierd-svc.h"
-#include "glusterd-tierd-svc-helper.h"
#include "glusterd-shd-svc-helper.h"
#include "glusterd-scrub-svc.h"
#include "glusterd-svc-helper.h"
diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-helper.h b/xlators/mgmt/glusterd/src/glusterd-svc-helper.h
index 5def2468785..12717dc58ac 100644
--- a/xlators/mgmt/glusterd/src/glusterd-svc-helper.h
+++ b/xlators/mgmt/glusterd/src/glusterd-svc-helper.h
@@ -32,15 +32,6 @@ int
glusterd_svc_check_topology_identical(char *svc_name,
glusterd_graph_builder_t builder,
gf_boolean_t *identical);
-
-int
-glusterd_svc_check_tier_volfile_identical(char *svc_name,
- glusterd_volinfo_t *volinfo,
- gf_boolean_t *identical);
-int
-glusterd_svc_check_tier_topology_identical(char *svc_name,
- glusterd_volinfo_t *volinfo,
- gf_boolean_t *identical);
int
glusterd_volume_svc_check_volfile_identical(char *svc_name, dict_t *mode_dict,
glusterd_volinfo_t *volinfo,
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c
index 7651a3b0fad..1c85c87a3f0 100644
--- a/xlators/mgmt/glusterd/src/glusterd-syncop.c
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c
@@ -228,7 +228,6 @@ glusterd_syncop_aggr_rsp_dict(glusterd_op_t op, dict_t *aggr, dict_t *rsp)
case GD_OP_CREATE_VOLUME:
case GD_OP_ADD_BRICK:
case GD_OP_START_VOLUME:
- case GD_OP_ADD_TIER_BRICK:
ret = glusterd_aggr_brick_mount_dirs(aggr, rsp);
if (ret) {
gf_msg(this->name, GF_LOG_ERROR, 0,
@@ -318,11 +317,6 @@ glusterd_syncop_aggr_rsp_dict(glusterd_op_t op, dict_t *aggr, dict_t *rsp)
ret = glusterd_volume_rebalance_use_rsp_dict(aggr, rsp);
break;
- case GD_OP_TIER_STATUS:
- case GD_OP_DETACH_TIER_STATUS:
- case GD_OP_REMOVE_TIER_BRICK:
- ret = glusterd_volume_tier_use_rsp_dict(aggr, rsp);
- /* FALLTHROUGH */
default:
break;
}
@@ -1738,23 +1732,6 @@ gd_brick_op_phase(glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict,
goto out;
}
- /* Redirect operation to be detach tier via rebalance flow. */
- ret = dict_get_int32(req_dict, "command", &cmd);
- if (!ret) {
- if (cmd == GF_OP_CMD_DETACH_START) {
- /* this change is left to support backward
- * compatibility. */
- op = GD_OP_REBALANCE;
- ret = dict_set_int32(req_dict, "rebalance-command",
- GF_DEFRAG_CMD_START_DETACH_TIER);
- } else if (cmd == GF_DEFRAG_CMD_DETACH_START) {
- op = GD_OP_REMOVE_TIER_BRICK;
- ret = dict_set_int32(req_dict, "rebalance-command",
- GF_DEFRAG_CMD_DETACH_START);
- }
- if (ret)
- goto out;
- }
ret = gd_syncop_mgmt_brick_op(rpc, pending_node, op, req_dict, op_ctx,
op_errstr);
if (op == GD_OP_STATUS_VOLUME) {
@@ -1766,13 +1743,6 @@ gd_brick_op_phase(glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict,
if (dict_get(op_ctx, "client-count"))
break;
}
- /* coverity[MIXED_ENUMS] */
- } else if (cmd == GF_OP_CMD_DETACH_START) {
- op = GD_OP_REMOVE_BRICK;
- dict_del(req_dict, "rebalance-command");
- } else if (cmd == GF_DEFRAG_CMD_DETACH_START) {
- op = GD_OP_REMOVE_TIER_BRICK;
- dict_del(req_dict, "rebalance-command");
}
if (ret)
goto out;
diff --git a/xlators/mgmt/glusterd/src/glusterd-tier.c b/xlators/mgmt/glusterd/src/glusterd-tier.c
deleted file mode 100644
index e4b79dfc862..00000000000
--- a/xlators/mgmt/glusterd/src/glusterd-tier.c
+++ /dev/null
@@ -1,1379 +0,0 @@
-/*
- Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com>
- This file is part of GlusterFS.
-
- This file is licensed to you under your choice of the GNU Lesser
- General Public License, version 3 or any later version (LGPLv3 or
- later), or the GNU General Public License, version 2 (GPLv2), in all
- cases as published by the Free Software Foundation.
- */
-
-#include <glusterfs/common-utils.h>
-#include "cli1-xdr.h"
-#include "xdr-generic.h"
-#include "glusterd.h"
-#include "glusterd-op-sm.h"
-#include "glusterd-store.h"
-#include "glusterd-geo-rep.h"
-#include "glusterd-utils.h"
-#include "glusterd-volgen.h"
-#include <glusterfs/run.h>
-#include <glusterfs/syscall.h>
-#include <glusterfs/byte-order.h>
-#include "glusterd-svc-helper.h"
-#include <glusterfs/compat-errno.h>
-#include "glusterd-tierd-svc.h"
-#include "glusterd-tierd-svc-helper.h"
-#include "glusterd-messages.h"
-#include "glusterd-mgmt.h"
-#include "glusterd-syncop.h"
-#include "glusterd-shd-svc-helper.h"
-
-#include <sys/wait.h>
-#include <dlfcn.h>
-
-extern struct rpc_clnt_program gd_brick_prog;
-
-const char *gd_tier_op_list[GF_DEFRAG_CMD_TYPE_MAX] = {
- [GF_DEFRAG_CMD_START_TIER] = "start",
- [GF_DEFRAG_CMD_STOP_TIER] = "stop",
-};
-
-int
-__glusterd_handle_tier(rpcsvc_request_t *req)
-{
- int32_t ret = -1;
- gf_cli_req cli_req = {{
- 0,
- }};
- dict_t *dict = NULL;
- glusterd_op_t cli_op = GD_OP_TIER_START_STOP;
- char *volname = NULL;
- int32_t cmd = 0;
- char msg[2048] = {
- 0,
- };
- xlator_t *this = NULL;
- glusterd_conf_t *conf = NULL;
- glusterd_volinfo_t *volinfo = NULL;
- char err_str[2048] = {0};
-
- this = THIS;
- GF_VALIDATE_OR_GOTO(THIS->name, this, out);
- GF_VALIDATE_OR_GOTO(this->name, req, out);
-
- conf = this->private;
- GF_VALIDATE_OR_GOTO(this->name, conf, out);
-
- ret = xdr_to_generic(req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
- if (ret < 0) {
- req->rpc_err = GARBAGE_ARGS;
- goto out;
- }
-
- if (cli_req.dict.dict_len) {
- /* Unserialize the dictionary */
- dict = dict_new();
-
- ret = dict_unserialize(cli_req.dict.dict_val, cli_req.dict.dict_len,
- &dict);
- if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_UNSERIALIZE_FAIL,
- "failed to "
- "unserialize req-buffer to dictionary");
- snprintf(msg, sizeof(msg),
- "Unable to decode the "
- "command");
- goto out;
- } else {
- dict->extra_stdfree = cli_req.dict.dict_val;
- }
- }
-
- ret = dict_get_strn(dict, "volname", SLEN("volname"), &volname);
- if (ret) {
- snprintf(msg, sizeof(msg), "Unable to get volume name");
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "Unable to get volume name, "
- "while handling tier command");
- goto out;
- }
-
- ret = dict_get_int32n(dict, "rebalance-command", SLEN("rebalance-command"),
- &cmd);
- if (ret) {
- snprintf(msg, sizeof(msg), "Unable to get the command");
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "Unable to get the cmd");
- goto out;
- }
-
- if (conf->op_version < GD_OP_VERSION_3_7_0) {
- snprintf(msg, sizeof(msg),
- "Cannot execute command. The "
- "cluster is operating at version %d. Tier command "
- "%s is unavailable in this version",
- conf->op_version, gd_tier_op_list[cmd]);
- ret = -1;
- goto out;
- }
-
- if (conf->op_version < GD_OP_VERSION_3_10_0) {
- gf_msg_debug(this->name, 0,
- "The cluster is operating at "
- "version less than or equal to %d. Falling back "
- "to syncop framework.",
- GD_OP_VERSION_3_7_5);
- switch (cmd) {
- case GF_DEFRAG_CMD_DETACH_STOP:
- ret = dict_set_int32n(dict, "rebalance-command",
- SLEN("rebalance-command"),
- GF_DEFRAG_CMD_STOP_DETACH_TIER);
- break;
-
- case GF_DEFRAG_CMD_DETACH_COMMIT:
- ret = glusterd_volinfo_find(volname, &volinfo);
- if (ret) {
- snprintf(err_str, sizeof(err_str),
- "Volume "
- "%s does not exist",
- volname);
- gf_msg(this->name, GF_LOG_ERROR, EINVAL,
- GD_MSG_VOL_NOT_FOUND, "%s", err_str);
- goto out;
- }
- ret = glusterd_set_detach_bricks(dict, volinfo);
- ret = dict_set_int32n(dict, "command", SLEN("command"),
- GF_OP_CMD_DETACH_COMMIT);
- break;
- case GF_DEFRAG_CMD_DETACH_COMMIT_FORCE:
- ret = glusterd_volinfo_find(volname, &volinfo);
- if (ret) {
- snprintf(err_str, sizeof(err_str),
- "Volume "
- "%s does not exist",
- volname);
- gf_msg(this->name, GF_LOG_ERROR, EINVAL,
- GD_MSG_VOL_NOT_FOUND, "%s", err_str);
- goto out;
- }
- ret = glusterd_set_detach_bricks(dict, volinfo);
- ret = dict_set_int32n(dict, "command", SLEN("command"),
- GF_OP_CMD_DETACH_COMMIT_FORCE);
- break;
- case GF_DEFRAG_CMD_DETACH_START:
- ret = glusterd_volinfo_find(volname, &volinfo);
- if (ret) {
- snprintf(err_str, sizeof(err_str),
- "Volume "
- "%s does not exist",
- volname);
- gf_msg(this->name, GF_LOG_ERROR, EINVAL,
- GD_MSG_VOL_NOT_FOUND, "%s", err_str);
- goto out;
- }
- ret = glusterd_set_detach_bricks(dict, volinfo);
- ret = dict_set_int32n(dict, "command", SLEN("command"),
- GF_OP_CMD_DETACH_START);
- break;
-
- default:
- break;
- }
- if (ret) {
- gf_log(this->name, GF_LOG_ERROR, "Failed to set dict");
- goto out;
- }
- if ((cmd == GF_DEFRAG_CMD_STATUS_TIER) ||
- (cmd == GF_DEFRAG_CMD_DETACH_STATUS) ||
- (cmd == GF_DEFRAG_CMD_START_TIER) ||
- (cmd == GF_DEFRAG_CMD_DETACH_STOP)) {
- ret = glusterd_op_begin(req, GD_OP_DEFRAG_BRICK_VOLUME, dict, msg,
- sizeof(msg));
- } else
- ret = glusterd_op_begin(req, GD_OP_REMOVE_BRICK, dict, msg,
- sizeof(msg));
-
- glusterd_friend_sm();
- glusterd_op_sm();
-
- } else {
- switch (cmd) {
- case GF_DEFRAG_CMD_STATUS_TIER:
- cli_op = GD_OP_TIER_STATUS;
- break;
-
- case GF_DEFRAG_CMD_DETACH_STATUS:
- cli_op = GD_OP_DETACH_TIER_STATUS;
- break;
-
- case GF_DEFRAG_CMD_DETACH_STOP:
- cli_op = GD_OP_REMOVE_TIER_BRICK;
- break;
-
- case GF_DEFRAG_CMD_DETACH_COMMIT:
- case GF_DEFRAG_CMD_DETACH_COMMIT_FORCE:
- case GF_DEFRAG_CMD_DETACH_START:
- cli_op = GD_OP_REMOVE_TIER_BRICK;
- ret = glusterd_volinfo_find(volname, &volinfo);
- if (ret) {
- snprintf(err_str, sizeof(err_str),
- "Volume "
- "%s does not exist",
- volname);
- gf_msg(this->name, GF_LOG_ERROR, EINVAL,
- GD_MSG_VOL_NOT_FOUND, "%s", err_str);
- goto out;
- }
- ret = glusterd_set_detach_bricks(dict, volinfo);
- break;
-
- default:
- break;
- }
- if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
- "dict set failed");
- goto out;
- }
- ret = glusterd_mgmt_v3_initiate_all_phases(req, cli_op, dict);
- }
-
-out:
- if (ret) {
- if (msg[0] == '\0')
- snprintf(msg, sizeof(msg), "Tier operation failed");
- ret = glusterd_op_send_cli_response(cli_op, ret, 0, req, dict, msg);
- }
-
- return ret;
-}
-
-int
-glusterd_handle_tier(rpcsvc_request_t *req)
-{
- return glusterd_big_locked_handler(req, __glusterd_handle_tier);
-}
-
-int
-glusterd_op_remove_tier_brick(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
-{
- glusterd_conf_t *priv = NULL;
- xlator_t *this = NULL;
- int ret = -1;
- char *volname = NULL;
- glusterd_volinfo_t *volinfo = NULL;
- char *brick = NULL;
- int32_t count = 0;
- int32_t i = 1;
- char key[256] = {
- 0,
- };
- int keylen;
- int32_t flag = 0;
- char err_str[4096] = {
- 0,
- };
- int need_rebalance = 0;
- int force = 0;
- int32_t cmd = 0;
- int32_t replica_count = 0;
- glusterd_brickinfo_t *brickinfo = NULL;
- glusterd_brickinfo_t *tmp = NULL;
- char *task_id_str = NULL;
- dict_t *bricks_dict = NULL;
- char *brick_tmpstr = NULL;
- uint32_t commit_hash = 0;
- int detach_commit = 0;
- void *tier_info = NULL;
- char *cold_shd_key = NULL;
- char *hot_shd_key = NULL;
- int delete_key = 1;
- glusterd_svc_t *svc = NULL;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO(THIS->name, this, out);
- GF_VALIDATE_OR_GOTO(this->name, dict, out);
- GF_VALIDATE_OR_GOTO(this->name, op_errstr, out);
-
- priv = this->private;
- GF_VALIDATE_OR_GOTO(this->name, priv, out);
-
- ret = dict_get_strn(dict, "volname", SLEN("volname"), &volname);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "Unable to get volume name");
- goto out;
- }
-
- ret = glusterd_volinfo_find(volname, &volinfo);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, GD_MSG_VOL_NOT_FOUND,
- "Unable to get volinfo");
- goto out;
- }
-
- ret = dict_get_int32n(dict, "rebalance-command", SLEN("rebalance-command"),
- &cmd);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_GET_FAILED,
- "cmd not found");
- goto out;
- }
-
- if (is_origin_glusterd(dict) && (cmd != GF_DEFRAG_CMD_DETACH_START)) {
- if (!gf_uuid_is_null(volinfo->rebal.rebalance_id)) {
- ret = glusterd_copy_uuid_to_dict(volinfo->rebal.rebalance_id, dict,
- GF_REMOVE_BRICK_TID_KEY,
- SLEN(GF_REMOVE_BRICK_TID_KEY));
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- GD_MSG_REMOVE_BRICK_ID_SET_FAIL,
- "Failed to set remove-brick-id");
- goto out;
- }
- }
- }
- /*check only if a tierd is supposed to be running
- * if no brick in the tierd volume is a local brick
- * skip it */
- cds_list_for_each_entry(brickinfo, &volinfo->bricks, brick_list)
- {
- if (glusterd_is_local_brick(this, volinfo, brickinfo)) {
- flag = _gf_true;
- break;
- }
- }
- if (!flag)
- goto out;
-
- ret = -1;
-
- switch (cmd) {
- case GF_DEFRAG_CMD_DETACH_STOP:
- /* Fall back to the old volume file */
- cds_list_for_each_entry_safe(brickinfo, tmp, &volinfo->bricks,
- brick_list)
- {
- if (!brickinfo->decommissioned)
- continue;
- brickinfo->decommissioned = 0;
- }
- volinfo->tier.op = GD_OP_DETACH_NOT_STARTED;
- ret = volinfo->tierd.svc.manager(&(volinfo->tierd.svc), volinfo,
- PROC_START_NO_WAIT);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- GD_MSG_MANAGER_FUNCTION_FAILED,
- "Calling manager for tier "
- "failed on volume: %s for "
- "detach stop",
- volinfo->volname);
- goto out;
- }
-
- ret = glusterd_create_volfiles_and_notify_services(volinfo);
-
- if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0,
- GD_MSG_VOLFILE_CREATE_FAIL, "failed to create volfiles");
- goto out;
- }
-
- ret = glusterd_store_volinfo(volinfo,
- GLUSTERD_VOLINFO_VER_AC_INCREMENT);
- if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, GD_MSG_VOLINFO_SET_FAIL,
- "failed to store volinfo");
- goto out;
- }
- ret = 0;
- goto out;
-
- case GF_DEFRAG_CMD_DETACH_START:
- volinfo->tier.op = GD_OP_DETACH_TIER;
- svc = &(volinfo->tierd.svc);
- ret = svc->manager(svc, volinfo, PROC_START_NO_WAIT);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- GD_MSG_MANAGER_FUNCTION_FAILED,
- "calling manager for tier "
- "failed on volume: %s for "
- "detach start",
- volname);
- goto out;
- }
- ret = dict_get_strn(dict, GF_REMOVE_BRICK_TID_KEY,
- SLEN(GF_REMOVE_BRICK_TID_KEY), &task_id_str);
- if (ret) {
- gf_msg_debug(this->name, errno, "Missing remove-brick-id");
- ret = 0;
- } else {
- ret = dict_set_strn(rsp_dict, GF_REMOVE_BRICK_TID_KEY,
- SLEN(GF_REMOVE_BRICK_TID_KEY), task_id_str);
- if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0,
- GD_MSG_DICT_SET_FAILED,
- "failed to set remove-brick-id"
- "in the dict");
- }
- gf_uuid_parse(task_id_str, volinfo->tier.rebalance_id);
- }
- force = 0;
-
- break;
-
- case GF_DEFRAG_CMD_DETACH_COMMIT:
- if (volinfo->decommission_in_progress) {
- gf_asprintf(op_errstr,
- "use 'force' option as "
- "migration is in progress");
- goto out;
- }
- if (volinfo->rebal.defrag_status == GF_DEFRAG_STATUS_FAILED) {
- gf_asprintf(op_errstr,
- "use 'force' option as "
- "migration has failed");
- goto out;
- }
- /* Fall through */
-
- case GF_DEFRAG_CMD_DETACH_COMMIT_FORCE:
- if (cmd == GF_DEFRAG_CMD_DETACH_COMMIT_FORCE) {
- svc = &(volinfo->tierd.svc);
- ret = svc->manager(svc, volinfo, PROC_START_NO_WAIT);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- GD_MSG_MANAGER_FUNCTION_FAILED,
- "calling manager for tier "
- "failed on volume: %s for "
- "commit force",
- volname);
- goto out;
- }
- }
- glusterd_op_perform_detach_tier(volinfo);
- detach_commit = 1;
-
- /* Disabling ctr when detaching a tier, since
- * currently tier is the only consumer of ctr.
- * Revisit this code when this constraint no
- * longer exist.
- */
- dict_deln(volinfo->dict, "features.ctr-enabled",
- SLEN("features.ctr-enabled"));
- dict_deln(volinfo->dict, "cluster.tier-mode",
- SLEN("cluster.tier-mode"));
-
- hot_shd_key = gd_get_shd_key(volinfo->tier_info.hot_type);
- cold_shd_key = gd_get_shd_key(volinfo->tier_info.cold_type);
- if (hot_shd_key) {
- /*
- * Since post detach, shd graph will not
- * contain hot tier. So we need to clear
- * option set for hot tier. For a tiered
- * volume there can be different key
- * for both hot and cold. If hot tier is
- * shd compatible then we need to remove
- * the configured value when detaching a tier,
- * only if the key's are different or
- * cold key is NULL. So we will set
- * delete_key first, and if cold key is not
- * null and they are equal then we will clear
- * the flag. Otherwise we will delete the
- * key.
- */
-
- if (cold_shd_key)
- delete_key = strcmp(hot_shd_key, cold_shd_key);
- if (delete_key)
- dict_del(volinfo->dict, hot_shd_key);
- }
- /* fall through */
-
- if (volinfo->decommission_in_progress) {
- if (volinfo->tier.defrag) {
- LOCK(&volinfo->rebal.defrag->lock);
- /* Fake 'rebalance-complete' so the
- * graph change
- * happens right away */
- volinfo->tier.defrag_status = GF_DEFRAG_STATUS_COMPLETE;
-
- UNLOCK(&volinfo->tier.defrag->lock);
- }
- }
-
- volinfo->tier.op = GD_OP_DETACH_NOT_STARTED;
- ret = 0;
- force = 1;
- break;
- default:
- gf_asprintf(op_errstr,
- "tier command failed. Invalid "
- "opcode");
- ret = -1;
- goto out;
- }
-
- count = glusterd_set_detach_bricks(dict, volinfo);
-
- if (cmd == GF_DEFRAG_CMD_DETACH_START) {
- bricks_dict = dict_new();
- if (!bricks_dict) {
- ret = -1;
- goto out;
- }
- ret = dict_set_int32n(bricks_dict, "count", SLEN("count"), count);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_SET_FAILED,
- "Failed to save remove-brick count");
- goto out;
- }
- }
-
- while (i <= count) {
- keylen = snprintf(key, sizeof(key), "brick%d", i);
- ret = dict_get_strn(dict, key, keylen, &brick);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "Unable to get %s", key);
- goto out;
- }
-
- if (cmd == GF_DEFRAG_CMD_DETACH_START) {
- brick_tmpstr = gf_strdup(brick);
- if (!brick_tmpstr) {
- ret = -1;
- gf_msg(this->name, GF_LOG_ERROR, ENOMEM, GD_MSG_NO_MEMORY,
- "Failed to duplicate brick name");
- goto out;
- }
- ret = dict_set_dynstrn(bricks_dict, key, keylen, brick_tmpstr);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_SET_FAILED,
- "Failed to add brick to dict");
- goto out;
- }
- brick_tmpstr = NULL;
- }
-
- ret = glusterd_op_perform_remove_brick(volinfo, brick, force,
- &need_rebalance);
- if (ret)
- goto out;
- i++;
- }
-
- if (detach_commit) {
- /* Clear related information from volinfo */
- tier_info = ((void *)(&volinfo->tier_info));
- memset(tier_info, 0, sizeof(volinfo->tier_info));
- }
-
- if (cmd == GF_DEFRAG_CMD_DETACH_START)
- volinfo->tier.dict = dict_ref(bricks_dict);
-
- ret = dict_get_int32n(dict, "replica-count", SLEN("replica-count"),
- &replica_count);
- if (!ret) {
- gf_msg(this->name, GF_LOG_INFO, errno, GD_MSG_DICT_GET_FAILED,
- "changing replica count %d to %d on volume %s",
- volinfo->replica_count, replica_count, volinfo->volname);
- volinfo->replica_count = replica_count;
- volinfo->sub_count = replica_count;
- volinfo->dist_leaf_count = glusterd_get_dist_leaf_count(volinfo);
-
- /*
- * volinfo->type and sub_count have already been set for
- * volumes undergoing a detach operation, they should not
- * be modified here.
- */
- if ((replica_count == 1) && (cmd != GF_DEFRAG_CMD_DETACH_COMMIT) &&
- (cmd != GF_DEFRAG_CMD_DETACH_COMMIT_FORCE)) {
- if (volinfo->type == GF_CLUSTER_TYPE_REPLICATE) {
- volinfo->type = GF_CLUSTER_TYPE_NONE;
- /* backward compatibility */
- volinfo->sub_count = 0;
- }
- }
- }
- volinfo->subvol_count = (volinfo->brick_count / volinfo->dist_leaf_count);
-
- ret = glusterd_create_volfiles_and_notify_services(volinfo);
- if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, GD_MSG_VOLFILE_CREATE_FAIL,
- "failed to create"
- "volfiles");
- goto out;
- }
-
- ret = glusterd_store_volinfo(volinfo, GLUSTERD_VOLINFO_VER_AC_INCREMENT);
- if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, GD_MSG_VOLINFO_STORE_FAIL,
- "failed to store volinfo");
- goto out;
- }
-
- if (cmd == GF_DEFRAG_CMD_DETACH_START &&
- volinfo->status == GLUSTERD_STATUS_STARTED) {
- ret = glusterd_svcs_reconfigure(volinfo);
- if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, GD_MSG_NFS_RECONF_FAIL,
- "Unable to reconfigure NFS-Server");
- goto out;
- }
- }
- /* Need to reset the defrag/rebalance status accordingly */
- switch (volinfo->tier.defrag_status) {
- case GF_DEFRAG_STATUS_FAILED:
- case GF_DEFRAG_STATUS_COMPLETE:
- volinfo->tier.defrag_status = 0;
- /* FALLTHROUGH */
- default:
- break;
- }
- if (!force && need_rebalance) {
- if (dict_get_uint32(dict, "commit-hash", &commit_hash) == 0) {
- volinfo->tier.commit_hash = commit_hash;
- }
- /* perform the rebalance operations */
- ret = glusterd_handle_defrag_start(
- volinfo, err_str, sizeof(err_str), GF_DEFRAG_CMD_START_DETACH_TIER,
- /*change this label to GF_DEFRAG_CMD_DETACH_START
- * while removing old code
- */
- glusterd_remove_brick_migrate_cbk, GD_OP_REMOVE_BRICK);
-
- if (!ret)
- volinfo->decommission_in_progress = 1;
-
- else if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_REBALANCE_START_FAIL,
- "failed to start the rebalance");
- }
- } else {
- if (GLUSTERD_STATUS_STARTED == volinfo->status)
- ret = glusterd_svcs_manager(volinfo);
- }
-
-out:
- if (ret && err_str[0] && op_errstr)
- *op_errstr = gf_strdup(err_str);
-
- GF_FREE(brick_tmpstr);
- if (bricks_dict)
- dict_unref(bricks_dict);
-
- return ret;
-}
-
-int
-glusterd_op_tier_start_stop(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
-{
- glusterd_volinfo_t *volinfo = NULL;
- int32_t ret = -1;
- char *volname = NULL;
- int cmd = -1;
- xlator_t *this = NULL;
- glusterd_brickinfo_t *brick = NULL;
- gf_boolean_t retval = _gf_false;
- glusterd_conf_t *priv = NULL;
- int32_t pid = -1;
- char pidfile[PATH_MAX] = {0};
- int is_force = 0;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO(THIS->name, this, out);
- GF_VALIDATE_OR_GOTO(this->name, dict, out);
- GF_VALIDATE_OR_GOTO(this->name, op_errstr, out);
-
- priv = this->private;
- GF_VALIDATE_OR_GOTO(this->name, priv, out);
-
- ret = dict_get_strn(dict, "volname", SLEN("volname"), &volname);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "Unable to get volume name");
- goto out;
- }
-
- ret = glusterd_volinfo_find(volname, &volinfo);
- if (ret) {
- gf_asprintf(op_errstr, FMTSTR_CHECK_VOL_EXISTS, volname);
- goto out;
- }
-
- ret = dict_get_int32n(dict, "rebalance-command", SLEN("rebalance-command"),
- &cmd);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "Unable to get cmd from "
- "dict");
- goto out;
- }
-
- cds_list_for_each_entry(brick, &volinfo->bricks, brick_list)
- {
- if (gf_uuid_compare(MY_UUID, brick->uuid) == 0) {
- retval = _gf_true;
- break;
- }
- }
- /*check if this node needs tierd*/
-
- if (!retval)
- goto out;
-
- if (glusterd_is_volume_started(volinfo) == 0) {
- *op_errstr = gf_strdup(
- "Volume is stopped, start "
- "volume to enable/disable tier.");
- ret = -1;
- goto out;
- }
-
- GLUSTERD_GET_TIER_PID_FILE(pidfile, volinfo, priv);
-
- switch (cmd) {
- case GF_DEFRAG_CMD_START_TIER:
- /* we check if its running and skip so that we don't get a
- * failure during force start
- */
- ret = dict_get_int32n(dict, "force", SLEN("force"), &is_force);
- if (ret) {
- gf_msg_debug(this->name, 0,
- "Unable to get is_force"
- " from dict");
- }
- ret = dict_set_int32n(volinfo->dict, "force", SLEN("force"),
- is_force);
- if (ret) {
- gf_msg_debug(this->name, errno,
- "Unable to set"
- " is_force to dict");
- }
-
- if (!is_force) {
- if (gf_is_service_running(pidfile, &pid)) {
- gf_asprintf(op_errstr,
- "Tier is already "
- "enabled on volume %s.",
- volinfo->volname);
- goto out;
- }
- }
-
- break;
-
- case GF_DEFRAG_CMD_STOP_TIER:
- if (!gf_is_service_running(pidfile, &pid)) {
- gf_asprintf(op_errstr,
- "Tier is alreaady disabled on "
- "volume %s.",
- volinfo->volname);
- goto out;
- }
- break;
- default:
- gf_asprintf(op_errstr,
- "tier command failed. Invalid "
- "opcode");
- ret = -1;
- goto out;
- }
-
- ret = volinfo->tierd.svc.manager(&(volinfo->tierd.svc), volinfo,
- PROC_START_NO_WAIT);
- if (ret)
- goto out;
-
- ret = glusterd_store_volinfo(volinfo, GLUSTERD_VOLINFO_VER_AC_INCREMENT);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VOLINFO_STORE_FAIL,
- "Failed to store volinfo for tier");
- goto out;
- }
-
-out:
- return ret;
-}
-
-int
-glusterd_op_stage_tier(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
-{
- char *volname = NULL;
- int ret = -1;
- int32_t cmd = 0;
- char msg[2048] = {0};
- glusterd_volinfo_t *volinfo = NULL;
- char *task_id_str = NULL;
- xlator_t *this = 0;
- int32_t is_force = 0;
- char pidfile[PATH_MAX] = {0};
- int32_t tier_online = -1;
- int32_t pid = -1;
- int32_t brick_count = 0;
- gsync_status_param_t param = {
- 0,
- };
- glusterd_conf_t *priv = NULL;
- gf_boolean_t flag = _gf_false;
- glusterd_brickinfo_t *brickinfo = NULL;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO(THIS->name, this, out);
- GF_VALIDATE_OR_GOTO(this->name, dict, out);
- GF_VALIDATE_OR_GOTO(this->name, op_errstr, out);
-
- priv = this->private;
- GF_VALIDATE_OR_GOTO(this->name, priv, out);
-
- ret = dict_get_strn(dict, "volname", SLEN("volname"), &volname);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_GET_FAILED,
- "volname not found");
- goto out;
- }
-
- ret = dict_get_int32n(dict, "rebalance-command", SLEN("rebalance-command"),
- &cmd);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_GET_FAILED,
- "cmd not found");
- goto out;
- }
-
- ret = glusterd_rebalance_cmd_validate(cmd, volname, &volinfo, msg,
- sizeof(msg));
- if (ret) {
- gf_msg_debug(this->name, 0, "cmd validate failed");
- goto out;
- }
-
- if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
- snprintf(msg, sizeof(msg),
- "volume %s is not a tier "
- "volume",
- volinfo->volname);
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VOL_NOT_TIER,
- "volume: %s is not a tier "
- "volume",
- volinfo->volname);
- ret = -1;
- goto out;
- }
- /* Check if the connected clients are all of version
- * glusterfs-3.6 and higher. This is needed to prevent some data
- * loss issues that could occur when older clients are connected
- * when rebalance is run. This check can be bypassed by using
- * 'force'
- */
- ret = glusterd_check_client_op_version_support(volname, GD_OP_VERSION_3_6_0,
- NULL);
- if (ret) {
- ret = gf_asprintf(op_errstr,
- "Volume %s has one or "
- "more connected clients of a version"
- " lower than GlusterFS-v3.6.0. "
- "Tier operations not supported in"
- " below this version",
- volname);
- goto out;
- }
- /*check only if a tierd is supposed to be running
- * if no brick in the tierd volume is a local brick
- * skip it */
- cds_list_for_each_entry(brickinfo, &volinfo->bricks, brick_list)
- {
- if (glusterd_is_local_brick(this, volinfo, brickinfo)) {
- flag = _gf_true;
- break;
- }
- }
- if (!flag)
- goto out;
-
- GLUSTERD_GET_TIER_PID_FILE(pidfile, volinfo, priv);
- tier_online = gf_is_service_running(pidfile, &pid);
-
- switch (cmd) {
- case GF_DEFRAG_CMD_START_TIER:
- ret = dict_get_int32n(dict, "force", SLEN("force"), &is_force);
- if (ret)
- is_force = 0;
-
- if (brickinfo->status != GF_BRICK_STARTED) {
- gf_asprintf(op_errstr,
- "Received"
- " tier start on volume "
- "with stopped brick %s",
- brickinfo->path);
- ret = -1;
- goto out;
- }
- if ((!is_force) && tier_online) {
- ret = gf_asprintf(op_errstr,
- "Tier daemon is "
- "already running on volume %s",
- volname);
- ret = -1;
- goto out;
- }
- ret = glusterd_defrag_start_validate(volinfo, msg, sizeof(msg),
- GD_OP_REBALANCE);
- if (ret) {
- gf_msg(this->name, 0, GF_LOG_ERROR, GD_MSG_REBALANCE_START_FAIL,
- "start validate failed");
- goto out;
- }
- if (volinfo->tier.op == GD_OP_DETACH_TIER) {
- snprintf(msg, sizeof(msg),
- "A detach tier task "
- "exists for volume %s. Either commit it"
- " or stop it before starting a new task.",
- volinfo->volname);
- gf_msg(this->name, GF_LOG_ERROR, 0,
- GD_MSG_OLD_REMOVE_BRICK_EXISTS,
- "Earlier detach-tier"
- " task exists for volume %s.",
- volinfo->volname);
- ret = -1;
- goto out;
- }
- break;
-
- case GF_DEFRAG_CMD_STOP_TIER:
-
- if (!tier_online) {
- ret = gf_asprintf(op_errstr,
- "Tier daemon is "
- "not running on volume %s",
- volname);
- ret = -1;
- goto out;
- }
- break;
-
- case GF_DEFRAG_CMD_DETACH_START:
-
- ret = dict_get_int32n(dict, "count", SLEN("count"), &brick_count);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "Unable to get brick count");
- goto out;
- }
-
- if (!tier_online) {
- ret = gf_asprintf(op_errstr,
- "Tier daemon is "
- "not running on volume %s",
- volname);
- ret = -1;
- goto out;
- }
- if (volinfo->tier.op == GD_OP_DETACH_TIER) {
- snprintf(msg, sizeof(msg),
- "An earlier detach tier "
- "task exists for volume %s. Either commit it"
- " or stop it before starting a new task.",
- volinfo->volname);
- gf_msg(this->name, GF_LOG_ERROR, 0,
- GD_MSG_OLD_REMOVE_BRICK_EXISTS,
- "Earlier remove-brick"
- " task exists for volume %s.",
- volinfo->volname);
- ret = -1;
- goto out;
- }
- if (glusterd_is_defrag_on(volinfo)) {
- snprintf(msg, sizeof(msg),
- "Migration is in progress."
- " Please retry after completion");
- gf_msg(this->name, GF_LOG_WARNING, 0, GD_MSG_OIP_RETRY_LATER,
- "Migration is"
- "in progress");
- goto out;
- }
-
- ret = glusterd_remove_brick_validate_bricks(
- GF_OP_CMD_NONE, brick_count, dict, volinfo, op_errstr, cmd);
- if (ret)
- goto out;
-
- if (is_origin_glusterd(dict)) {
- ret = glusterd_generate_and_set_task_id(
- dict, GF_REMOVE_BRICK_TID_KEY,
- SLEN(GF_REMOVE_BRICK_TID_KEY));
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_TASKID_GEN_FAIL,
- "Failed to generate task-id");
- goto out;
- }
- } else {
- ret = dict_get_strn(dict, GF_REMOVE_BRICK_TID_KEY,
- SLEN(GF_REMOVE_BRICK_TID_KEY),
- &task_id_str);
- if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, errno,
- GD_MSG_DICT_GET_FAILED, "Missing remove-brick-id");
- ret = 0;
- }
- }
- break;
-
- case GF_DEFRAG_CMD_DETACH_STOP:
- if (volinfo->tier.op != GD_OP_DETACH_TIER) {
- snprintf(msg, sizeof(msg),
- "Detach-tier "
- "not started");
- ret = -1;
- goto out;
- }
- ret = 0;
- break;
-
- case GF_DEFRAG_CMD_STATUS_TIER:
-
- if (!tier_online) {
- ret = gf_asprintf(op_errstr,
- "Tier daemon is "
- "not running on volume %s",
- volname);
- ret = -1;
- goto out;
- }
- break;
-
- case GF_DEFRAG_CMD_DETACH_COMMIT:
-
- if (volinfo->tier.op != GD_OP_DETACH_TIER) {
- snprintf(msg, sizeof(msg),
- "Detach-tier "
- "not started");
- ret = -1;
- goto out;
- }
- if ((volinfo->rebal.defrag_status == GF_DEFRAG_STATUS_STARTED) &&
- (volinfo->tier.op == GD_OP_DETACH_TIER)) {
- ret = -1;
- snprintf(msg, sizeof(msg),
- "Detach is in progress. "
- "Please retry after completion");
- gf_msg(this->name, GF_LOG_WARNING, 0, GD_MSG_OIP_RETRY_LATER,
- "Detach is in "
- "progress");
- goto out;
- }
-
- ret = dict_get_int32n(dict, "count", SLEN("count"), &brick_count);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "Unable to get brick count");
- goto out;
- }
-
- ret = glusterd_remove_brick_validate_bricks(
- GF_OP_CMD_NONE, brick_count, dict, volinfo, op_errstr, cmd);
- if (ret)
- goto out;
-
- /* If geo-rep is configured, for this volume, it should be
- * stopped.
- */
- param.volinfo = volinfo;
- ret = glusterd_check_geo_rep_running(&param, op_errstr);
- if (ret || param.is_active) {
- ret = -1;
- goto out;
- }
-
- break;
- case GF_DEFRAG_CMD_DETACH_STATUS:
- if (volinfo->tier.op != GD_OP_DETACH_TIER) {
- snprintf(msg, sizeof(msg),
- "Detach-tier "
- "not started");
- ret = -1;
- goto out;
- }
- break;
-
- case GF_DEFRAG_CMD_DETACH_COMMIT_FORCE:
- default:
- break;
- }
-
- ret = 0;
-out:
- if (ret && op_errstr && msg[0])
- *op_errstr = gf_strdup(msg);
-
- return ret;
-}
-
-int32_t
-glusterd_add_tierd_to_dict(glusterd_volinfo_t *volinfo, dict_t *dict,
- int32_t count)
-{
- int ret = -1;
- int32_t pid = -1;
- int32_t brick_online = -1;
- char key[64] = {0};
- int keylen;
- char pidfile[PATH_MAX] = {0};
- xlator_t *this = NULL;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO(THIS->name, this, out);
-
- GF_VALIDATE_OR_GOTO(this->name, volinfo, out);
- GF_VALIDATE_OR_GOTO(this->name, dict, out);
-
- keylen = snprintf(key, sizeof(key), "brick%d.hostname", count);
- ret = dict_set_nstrn(dict, key, keylen, "Tier Daemon", SLEN("Tier Daemon"));
- if (ret)
- goto out;
-
- keylen = snprintf(key, sizeof(key), "brick%d.path", count);
- ret = dict_set_dynstrn(dict, key, keylen, gf_strdup(uuid_utoa(MY_UUID)));
- if (ret)
- goto out;
-
- /* tier doesn't have a port. but the cli needs a port key with
- * an zero value to parse.
- * */
-
- keylen = snprintf(key, sizeof(key), "brick%d.port", count);
- ret = dict_set_int32n(dict, key, keylen, 0);
- if (ret)
- goto out;
-
- glusterd_svc_build_tierd_pidfile(volinfo, pidfile, sizeof(pidfile));
-
- brick_online = gf_is_service_running(pidfile, &pid);
-
- keylen = snprintf(key, sizeof(key), "brick%d.pid", count);
- ret = dict_set_int32n(dict, key, keylen, pid);
- if (ret)
- goto out;
-
- keylen = snprintf(key, sizeof(key), "brick%d.status", count);
- ret = dict_set_int32n(dict, key, keylen, brick_online);
-
-out:
- if (ret)
- gf_msg(this ? this->name : "glusterd", GF_LOG_ERROR, 0,
- GD_MSG_DICT_SET_FAILED,
- "Returning %d. adding values to dict failed", ret);
-
- return ret;
-}
-
-int32_t
-__glusterd_tier_status_cbk(struct rpc_req *req, struct iovec *iov, int count,
- void *myframe)
-{
- gd1_mgmt_brick_op_rsp rsp = {0};
- int ret = -1;
- call_frame_t *frame = NULL;
- xlator_t *this = NULL;
- glusterd_conf_t *priv = NULL;
- struct syncargs *args = NULL;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO(THIS->name, this, out);
- GF_VALIDATE_OR_GOTO(this->name, req, out);
-
- priv = this->private;
- GF_VALIDATE_OR_GOTO(this->name, priv, out);
-
- frame = myframe;
- args = frame->local;
-
- if (-1 == req->rpc_status) {
- args->op_errno = ENOTCONN;
- goto out;
- }
-
- ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_brick_op_rsp);
- if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_RES_DECODE_FAIL,
- "Failed to decode brick op "
- "response received");
- goto out;
- }
-
- if (rsp.output.output_len) {
- args->dict = dict_new();
- if (!args->dict) {
- ret = -1;
- args->op_errno = ENOMEM;
- goto out;
- }
-
- ret = dict_unserialize(rsp.output.output_val, rsp.output.output_len,
- &args->dict);
- if (ret < 0)
- goto out;
- }
- args->op_ret = rsp.op_ret;
- args->op_errno = rsp.op_errno;
- args->errstr = gf_strdup(rsp.op_errstr);
-
-out:
- if ((rsp.op_errstr) && (strcmp(rsp.op_errstr, "") != 0))
- free(rsp.op_errstr);
- free(rsp.output.output_val);
- if (req && (req->rpc_status != -1) && (frame)) {
- GLUSTERD_STACK_DESTROY(frame);
- }
- if (args) {
- __wake(args);
- }
-
- return ret;
-}
-
-int32_t
-glusterd_tier_status_cbk(struct rpc_req *req, struct iovec *iov, int count,
- void *myframe)
-{
- return glusterd_big_locked_cbk(req, iov, count, myframe,
- __glusterd_tier_status_cbk);
-}
-
-int
-glusterd_op_tier_status(dict_t *dict, char **op_errstr, dict_t *rsp_dict,
- glusterd_op_t op)
-{
- int ret = -1;
- xlator_t *this = NULL;
- struct syncargs args = {
- 0,
- };
- gd1_mgmt_brick_op_req *req = NULL;
- glusterd_conf_t *priv = NULL;
- int pending_bricks = 0;
- glusterd_pending_node_t *pending_node;
- glusterd_req_ctx_t *req_ctx = NULL;
- struct rpc_clnt *rpc = NULL;
- uuid_t *txn_id = NULL;
- extern glusterd_op_info_t opinfo;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO(THIS->name, this, out);
- GF_VALIDATE_OR_GOTO(this->name, dict, out);
- GF_VALIDATE_OR_GOTO(this->name, rsp_dict, out);
-
- priv = this->private;
- GF_VALIDATE_OR_GOTO(this->name, priv, out);
- args.op_ret = -1;
- args.op_errno = ENOTCONN;
-
- req_ctx = GF_MALLOC(sizeof(*req_ctx), gf_gld_mt_op_allack_ctx_t);
- if (!req_ctx) {
- gf_msg(this->name, GF_LOG_ERROR, ENOMEM, GD_MSG_NO_MEMORY,
- "Allocation failed");
- goto out;
- }
-
- gf_uuid_copy(req_ctx->uuid, MY_UUID);
-
- /* we are printing the detach status for issue of detach start
- * by then we need the op to be GD_OP_DETACH_TIER_STATUS for it to
- * get the status. ad for the rest of the condition it can go as such.
- */
-
- if (op == GD_OP_REMOVE_TIER_BRICK)
- req_ctx->op = GD_OP_DETACH_TIER_STATUS;
- else
- req_ctx->op = op;
-
- req_ctx->dict = dict;
- txn_id = &priv->global_txn_id;
- CDS_INIT_LIST_HEAD(&opinfo.pending_bricks);
-
- ret = dict_get_bin(req_ctx->dict, "transaction_id", (void **)&txn_id);
- gf_msg_debug(this->name, 0, "transaction ID = %s", uuid_utoa(*txn_id));
-
- ret = glusterd_op_bricks_select(req_ctx->op, req_ctx->dict, op_errstr,
- &opinfo.pending_bricks, NULL);
-
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_BRICK_SELECT_FAIL,
- "Failed to select bricks");
- opinfo.op_errstr = *op_errstr;
- goto out;
- }
-
- cds_list_for_each_entry(pending_node, &opinfo.pending_bricks, list)
- {
- ret = glusterd_brick_op_build_payload(req_ctx->op, pending_node->node,
- (gd1_mgmt_brick_op_req **)&req,
- req_ctx->dict);
-
- if (ret || !req) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- GD_MSG_BRICK_OP_PAYLOAD_BUILD_FAIL,
- "Failed to build brick op payload during "
- "'Volume %s'",
- gd_op_list[req_ctx->op]);
- goto out;
- }
-
- rpc = glusterd_pending_node_get_rpc(pending_node);
- if (!rpc) {
- opinfo.brick_pending_count = 0;
- ret = 0;
- if (req) {
- if (req->input.input_val)
- GF_FREE(req->input.input_val);
- GF_FREE(req);
- req = NULL;
- }
- glusterd_defrag_volume_node_rsp(req_ctx->dict, NULL, rsp_dict);
-
- goto out;
- }
-
- GD_SYNCOP(rpc, (&args), NULL, glusterd_tier_status_cbk, req,
- &gd_brick_prog, req->op, xdr_gd1_mgmt_brick_op_req);
-
- if (req->input.input_val)
- GF_FREE(req->input.input_val);
- GF_FREE(req);
- req = NULL;
-
- if (!ret)
- pending_bricks++;
-
- glusterd_pending_node_put_rpc(pending_node);
- }
- glusterd_handle_node_rsp(req_ctx->dict, pending_node->node, req_ctx->op,
- args.dict, rsp_dict, op_errstr,
- pending_node->type);
- gf_msg_trace(this->name, 0,
- "Sent commit op req for operation "
- "'Volume %s' to %d bricks",
- gd_op_list[req_ctx->op], pending_bricks);
- opinfo.brick_pending_count = pending_bricks;
-out:
- if (ret)
- opinfo.op_ret = ret;
-
- ret = glusterd_set_txn_opinfo(txn_id, &opinfo);
- if (ret)
- gf_msg(THIS->name, GF_LOG_ERROR, 0, GD_MSG_TRANS_OPINFO_SET_FAIL,
- "Unable to set transaction's opinfo");
- if (args.dict)
- dict_unref(args.dict);
- if (args.errstr)
- GF_FREE(args.errstr);
-
- if (req_ctx)
- GF_FREE(req_ctx);
-
- gf_msg_debug(this ? this->name : "glusterd", 0,
- "Returning %d. Failed to get tier status", ret);
- return ret;
-}
diff --git a/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.h b/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.h
deleted file mode 100644
index 56b794df506..00000000000
--- a/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com>
- This file is part of GlusterFS.
-
- This file is licensed to you under your choice of the GNU Lesser
- General Public License, version 3 or any later version (LGPLv3 or
- later), or the GNU General Public License, version 2 (GPLv2), in all
- cases as published by the Free Software Foundation.
-*/
-
-#ifndef _GLUSTERD_TIERD_SVC_HELPER_H_
-#define _GLUSTERD_TIERD_SVC_HELPER_H_
-
-#include "glusterd.h"
-
-void
-glusterd_svc_build_tierd_rundir(glusterd_volinfo_t *volinfo, char *path,
- int path_len);
-
-void
-glusterd_svc_build_tierd_socket_filepath(glusterd_volinfo_t *volinfo,
- char *path, int path_len);
-
-void
-glusterd_svc_build_tierd_pidfile(glusterd_volinfo_t *volinfo, char *path,
- int path_len);
-
-void
-glusterd_svc_build_tierd_volfile_path(glusterd_volinfo_t *volinfo, char *path,
- int path_len);
-
-void
-glusterd_svc_build_tierd_logdir(char *logdir, char *volname, size_t len);
-
-void
-glusterd_svc_build_tierd_logfile(char *logfile, char *logdir, size_t len);
-#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-tierd-svc.c b/xlators/mgmt/glusterd/src/glusterd-tierd-svc.c
deleted file mode 100644
index ab463f19425..00000000000
--- a/xlators/mgmt/glusterd/src/glusterd-tierd-svc.c
+++ /dev/null
@@ -1,503 +0,0 @@
-/*
- Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com>
- This file is part of GlusterFS.
-
- This file is licensed to you under your choice of the GNU Lesser
- General Public License, version 3 or any later version (LGPLv3 or
- later), or the GNU General Public License, version 2 (GPLv2), in all
- cases as published by the Free Software Foundation.
-*/
-
-#include <glusterfs/globals.h>
-#include <glusterfs/run.h>
-#include "glusterd.h"
-#include "glusterd-utils.h"
-#include "glusterd-volgen.h"
-#include "glusterd-tierd-svc.h"
-#include "glusterd-tierd-svc-helper.h"
-#include "glusterd-svc-helper.h"
-#include <glusterfs/syscall.h>
-#include "glusterd-store.h"
-
-char *tierd_svc_name = "tierd";
-
-void
-glusterd_tierdsvc_build(glusterd_svc_t *svc)
-{
- svc->manager = glusterd_tierdsvc_manager;
- svc->start = glusterd_tierdsvc_start;
- svc->stop = glusterd_svc_stop;
- svc->reconfigure = glusterd_tierdsvc_reconfigure;
-}
-
-/* a separate service framework is used because the tierd is a
- * volume based framework while the common services are for node
- * based daemons. when volume based common framework is available
- * this can be consolidated into it.
- */
-
-int
-glusterd_tierdsvc_init(void *data)
-{
- int ret = -1;
- char rundir[PATH_MAX] = {
- 0,
- };
- char sockpath[PATH_MAX] = {
- 0,
- };
- char pidfile[PATH_MAX] = {
- 0,
- };
- char volfile[PATH_MAX] = {
- 0,
- };
- char logdir[PATH_MAX] = {
- 0,
- };
- char logfile[PATH_MAX] = {
- 0,
- };
- char volfileid[256] = {0};
- glusterd_svc_t *svc = NULL;
- glusterd_volinfo_t *volinfo = NULL;
- glusterd_conf_t *priv = NULL;
- glusterd_conn_notify_t notify = NULL;
- xlator_t *this = NULL;
- char *volfileserver = NULL;
- int32_t len = 0;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO(THIS->name, this, out);
-
- priv = this->private;
- GF_VALIDATE_OR_GOTO(this->name, priv, out);
-
- volinfo = data;
- GF_VALIDATE_OR_GOTO(this->name, data, out);
-
- svc = &(volinfo->tierd.svc);
-
- ret = snprintf(svc->name, sizeof(svc->name), "%s", tierd_svc_name);
- if (ret < 0)
- goto out;
-
- notify = glusterd_svc_common_rpc_notify;
-
- volinfo->type = GF_CLUSTER_TYPE_TIER;
-
- glusterd_svc_build_tierd_rundir(volinfo, rundir, sizeof(rundir));
- glusterd_svc_create_rundir(rundir);
-
- /* Initialize the connection mgmt */
- glusterd_svc_build_tierd_socket_filepath(volinfo, sockpath,
- sizeof(sockpath));
- ret = glusterd_conn_init(&(svc->conn), sockpath, 600, notify);
- if (ret)
- goto out;
-
- /* Initialize the process mgmt */
- glusterd_svc_build_tierd_pidfile(volinfo, pidfile, sizeof(pidfile));
- glusterd_svc_build_tierd_volfile_path(volinfo, volfile, sizeof(volfile));
- glusterd_svc_build_tierd_logdir(logdir, volinfo->volname, sizeof(logdir));
- ret = mkdir_p(logdir, 0755, _gf_true);
- if ((ret == -1) && (EEXIST != errno)) {
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_CREATE_DIR_FAILED,
- "Unable to create logdir %s", logdir);
- goto out;
- }
- glusterd_svc_build_tierd_logfile(logfile, logdir, sizeof(logfile));
- len = snprintf(volfileid, sizeof(volfileid), "tierd/%s", volinfo->volname);
- if ((len < 0) || (len >= sizeof(volfileid))) {
- ret = -1;
- goto out;
- }
-
- if (dict_get_strn(this->options, "transport.socket.bind-address",
- SLEN("transport.socket.bind-address"),
- &volfileserver) != 0) {
- volfileserver = "localhost";
- }
- ret = glusterd_proc_init(&(svc->proc), tierd_svc_name, pidfile, logdir,
- logfile, volfile, volfileid, volfileserver);
- if (ret)
- goto out;
-
-out:
- gf_msg_debug(this ? this->name : "glusterd", 0, "Returning %d", ret);
- return ret;
-}
-
-static int
-glusterd_tierdsvc_create_volfile(glusterd_volinfo_t *volinfo)
-{
- char filepath[PATH_MAX] = {
- 0,
- };
- int ret = -1;
- glusterd_conf_t *conf = NULL;
- xlator_t *this = NULL;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO(THIS->name, this, out);
- conf = this->private;
- GF_VALIDATE_OR_GOTO(this->name, conf, out);
-
- glusterd_svc_build_tierd_volfile_path(volinfo, filepath, sizeof(filepath));
- ret = build_rebalance_volfile(volinfo, filepath, NULL);
-
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VOLFILE_CREATE_FAIL,
- "Failed to create volfile");
- goto out;
- }
-
-out:
- gf_msg_debug(this ? this->name : "glusterd", 0, "Returning %d", ret);
-
- return ret;
-}
-
-int
-glusterd_tierdsvc_manager(glusterd_svc_t *svc, void *data, int flags)
-{
- int ret = 0;
- xlator_t *this = THIS;
- glusterd_volinfo_t *volinfo = NULL;
- int is_force = 0;
-
- volinfo = data;
- GF_VALIDATE_OR_GOTO(this->name, data, out);
-
- if (!svc->inited) {
- ret = glusterd_tierdsvc_init(volinfo);
- if (ret) {
- gf_msg(THIS->name, GF_LOG_ERROR, 0, GD_MSG_TIERD_INIT_FAIL,
- "Failed to initialize "
- "tierd service for volume %s",
- volinfo->volname);
- goto out;
- } else {
- svc->inited = _gf_true;
- gf_msg_debug(THIS->name, 0,
- "tierd service "
- "initialized");
- }
- }
-
- ret = dict_get_int32n(volinfo->dict, "force", SLEN("force"), &is_force);
- if (ret) {
- gf_msg_debug(this->name, errno,
- "Unable to get"
- " is_force from dict");
- }
-
- if (is_force)
- ret = 1;
- else
- ret = (glusterd_is_tierd_supposed_to_be_enabled(volinfo));
-
- if (ret) {
- if (!glusterd_is_volume_started(volinfo)) {
- if (glusterd_proc_is_running(&svc->proc)) {
- ret = svc->stop(svc, SIGTERM);
- if (ret)
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_SNAPD_STOP_FAIL,
- "Couldn't stop tierd for "
- "volume: %s",
- volinfo->volname);
- } else {
- /* Since tierd is not running set ret to 0 */
- ret = 0;
- }
- goto out;
- }
-
- ret = glusterd_tierdsvc_create_volfile(volinfo);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_TIERD_CREATE_FAIL,
- "Couldn't create "
- "tierd volfile for volume: %s",
- volinfo->volname);
- goto out;
- }
-
- ret = svc->start(svc, flags);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_TIERD_START_FAIL,
- "Couldn't start "
- "tierd for volume: %s",
- volinfo->volname);
- goto out;
- }
- volinfo->is_tier_enabled = _gf_true;
-
- glusterd_volinfo_ref(volinfo);
- ret = glusterd_conn_connect(&(svc->conn));
- if (ret) {
- glusterd_volinfo_unref(volinfo);
- goto out;
- }
- } else {
- if (glusterd_proc_is_running(&svc->proc)) {
- ret = svc->stop(svc, SIGTERM);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_TIERD_STOP_FAIL,
- "Couldn't stop tierd for volume: %s", volinfo->volname);
- goto out;
- }
- volinfo->is_tier_enabled = _gf_false;
- }
- ret = 0;
- }
-
-out:
- gf_msg_debug(THIS->name, 0, "Returning %d", ret);
-
- return ret;
-}
-
-int32_t
-glusterd_tierdsvc_start(glusterd_svc_t *svc, int flags)
-{
- int ret = -1;
- runner_t runner = {
- 0,
- };
- glusterd_conf_t *priv = NULL;
- xlator_t *this = NULL;
- char valgrind_logfile[PATH_MAX] = {0};
- char msg[1024] = {
- 0,
- };
- char tierd_id[PATH_MAX] = {
- 0,
- };
- glusterd_volinfo_t *volinfo = NULL;
- glusterd_tierdsvc_t *tierd = NULL;
- int cmd = GF_DEFRAG_CMD_START_TIER;
- char *localtime_logging = NULL;
- int32_t len = 0;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO(THIS->name, this, out);
-
- priv = this->private;
- GF_VALIDATE_OR_GOTO(this->name, priv, out);
-
- if (glusterd_proc_is_running(&svc->proc)) {
- ret = 0;
- goto out;
- }
-
- /* Get volinfo->tierd from svc object */
- tierd = cds_list_entry(svc, glusterd_tierdsvc_t, svc);
- if (!tierd) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_TIERD_OBJ_GET_FAIL,
- "Failed to get tierd object "
- "from tierd service");
- goto out;
- }
-
- /* Get volinfo from tierd */
- volinfo = cds_list_entry(tierd, glusterd_volinfo_t, tierd);
- if (!volinfo) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VOLINFO_GET_FAIL,
- "Failed to get volinfo from "
- "from tierd");
- goto out;
- }
-
- ret = sys_access(svc->proc.volfile, F_OK);
- if (ret) {
- gf_msg(this->name, GF_LOG_DEBUG, 0, GD_MSG_VOLINFO_GET_FAIL,
- "tierd Volfile %s is not present", svc->proc.volfile);
- /* If glusterd is down on one of the nodes and during
- * that time if tier is started for the first time. After some
- * time when the glusterd which was down comes back it tries
- * to look for the tierd volfile and it does not find tierd
- * volfile and because of this starting of tierd fails.
- * Therefore, if volfile is not present then create a fresh
- * volfile.
- */
- ret = glusterd_tierdsvc_create_volfile(volinfo);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VOLFILE_CREATE_FAIL,
- "Couldn't create "
- "tierd volfile for volume: %s",
- volinfo->volname);
- goto out;
- }
- }
- runinit(&runner);
-
- if (this->ctx->cmd_args.valgrind) {
- len = snprintf(valgrind_logfile, PATH_MAX, "%s/valgrind-tierd.log",
- svc->proc.logdir);
- if ((len < 0) || (len >= PATH_MAX)) {
- ret = -1;
- goto out;
- }
-
- runner_add_args(&runner, "valgrind", "--leak-check=full",
- "--trace-children=yes", "--track-origins=yes", NULL);
- runner_argprintf(&runner, "--log-file=%s", valgrind_logfile);
- }
-
- snprintf(tierd_id, sizeof(tierd_id), "tierd-%s", volinfo->volname);
- runner_add_args(
- &runner, SBIN_DIR "/glusterfs", "-s", svc->proc.volfileserver,
- "--volfile-id", svc->proc.volfileid, "-p", svc->proc.pidfile, "-l",
- svc->proc.logfile, "--brick-name", tierd_id, "-S", svc->conn.sockpath,
- "--xlator-option", "*dht.use-readdirp=yes", "--xlator-option",
- "*dht.lookup-unhashed=yes", "--xlator-option",
- "*dht.assert-no-child-down=yes", "--xlator-option",
- "*dht.readdir-optimize=on", "--xlator-option",
- "*tier-dht.xattr-name=trusted.tier.tier-dht", "--process-name",
- svc->name, NULL);
-
- runner_add_arg(&runner, "--xlator-option");
- runner_argprintf(&runner, "*dht.rebalance-cmd=%d", cmd);
- runner_add_arg(&runner, "--xlator-option");
- runner_argprintf(&runner, "*dht.node-uuid=%s", uuid_utoa(MY_UUID));
- runner_add_arg(&runner, "--xlator-option");
- runner_argprintf(&runner, "*dht.commit-hash=%u",
- volinfo->rebal.commit_hash);
- if (volinfo->memory_accounting)
- runner_add_arg(&runner, "--mem-accounting");
- if (dict_get_strn(priv->opts, GLUSTERD_LOCALTIME_LOGGING_KEY,
- SLEN(GLUSTERD_LOCALTIME_LOGGING_KEY),
- &localtime_logging) == 0) {
- if (strcmp(localtime_logging, "enable") == 0)
- runner_add_arg(&runner, "--localtime-logging");
- }
-
- snprintf(msg, sizeof(msg), "Starting the tierd service for volume %s",
- volinfo->volname);
- runner_log(&runner, this->name, GF_LOG_DEBUG, msg);
-
- if (flags == PROC_START_NO_WAIT) {
- ret = runner_run_nowait(&runner);
- } else {
- synclock_unlock(&priv->big_lock);
- {
- ret = runner_run(&runner);
- }
- synclock_lock(&priv->big_lock);
- }
-
-out:
- return ret;
-}
-
-int
-glusterd_tierdsvc_restart()
-{
- glusterd_volinfo_t *volinfo = NULL;
- glusterd_volinfo_t *tmp = NULL;
- int ret = 0;
- xlator_t *this = THIS;
- glusterd_conf_t *conf = NULL;
- glusterd_svc_t *svc = NULL;
-
- GF_VALIDATE_OR_GOTO(THIS->name, this, out);
-
- conf = this->private;
- GF_VALIDATE_OR_GOTO(this->name, conf, out);
-
- cds_list_for_each_entry_safe(volinfo, tmp, &conf->volumes, vol_list)
- {
- /* Start per volume tierd svc */
- if (volinfo->status == GLUSTERD_STATUS_STARTED &&
- volinfo->type == GF_CLUSTER_TYPE_TIER) {
- svc = &(volinfo->tierd.svc);
- if (volinfo->tier.op != GD_OP_DETACH_TIER) {
- ret = svc->manager(svc, volinfo, PROC_START_NO_WAIT);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_TIERD_START_FAIL,
- "Couldn't restart tierd for "
- "vol: %s",
- volinfo->volname);
- goto out;
- }
- }
- }
- }
-out:
- return ret;
-}
-
-int
-glusterd_tierdsvc_reconfigure(void *data)
-{
- int ret = -1;
- xlator_t *this = NULL;
- gf_boolean_t identical_topology = _gf_false;
- gf_boolean_t identical_volfile = _gf_false;
- glusterd_volinfo_t *volinfo = NULL;
-
- volinfo = data;
-
- /* reconfigure function is not available for other volume based
- * service. but it has been implemented for tier because there can be
- * changes on the volfile that need not be related to topology.
- * during these changes it is better not to restart the tierd.
- * So reconfigure is written to avoid calling restart at such
- * situations.
- */
-
- this = THIS;
- GF_VALIDATE_OR_GOTO(THIS->name, this, out);
-
- if (!glusterd_is_tierd_enabled(volinfo))
- goto manager;
- /*
- * Check both OLD and NEW volfiles, if they are SAME by size
- * and cksum i.e. "character-by-character". If YES, then
- * NOTHING has been changed, just return.
- */
-
- ret = glusterd_svc_check_tier_volfile_identical(
- volinfo->tierd.svc.name, volinfo, &identical_volfile);
- if (ret)
- goto out;
- if (identical_volfile) {
- ret = 0;
- goto out;
- }
-
- /*
- * They are not identical. Find out if the topology is changed
- * OR just the volume options. If just the options which got
- * changed, then inform the xlator to reconfigure the options.
- */
- ret = glusterd_svc_check_tier_topology_identical(
- volinfo->tierd.svc.name, volinfo, &identical_topology);
- if (ret)
- goto out; /*not able to compare due to some corruption */
-
- /* Topology is not changed, but just the options. But write the
- * options to tierd volfile, so that tierd will be reconfigured.
- */
- if (identical_topology) {
- ret = glusterd_tierdsvc_create_volfile(volinfo);
- if (ret == 0) { /* Only if above PASSES */
- ret = glusterd_fetchspec_notify(this);
- }
- goto out;
- }
- goto out;
- /*pending add/remove brick functionality*/
-
-manager:
- /*
- * tierd volfile's topology has been changed. tierd server needs
- * to be RESTARTED to ACT on the changed volfile.
- */
- ret = volinfo->tierd.svc.manager(&(volinfo->tierd.svc), volinfo,
- PROC_START_NO_WAIT);
-
-out:
- gf_msg_debug(THIS->name, 0, "Returning %d", ret);
- return ret;
-}
diff --git a/xlators/mgmt/glusterd/src/glusterd-tierd-svc.h b/xlators/mgmt/glusterd/src/glusterd-tierd-svc.h
deleted file mode 100644
index 78d3d11b6a3..00000000000
--- a/xlators/mgmt/glusterd/src/glusterd-tierd-svc.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com>
- This file is part of GlusterFS.
-
- This file is licensed to you under your choice of the GNU Lesser
- General Public License, version 3 or any later version (LGPLv3 or
- later), or the GNU General Public License, version 2 (GPLv2), in all
- cases as published by the Free Software Foundation.
-*/
-
-#ifndef _GLUSTERD_TIERD_SVC_H_
-#define _GLUSTERD_TIERD_SVC_H_
-
-#include "glusterd-svc-mgmt.h"
-
-typedef struct glusterd_tierdsvc_ glusterd_tierdsvc_t;
-
-struct glusterd_tierdsvc_ {
- glusterd_svc_t svc;
- gf_store_handle_t *handle;
-};
-
-void
-glusterd_tierdsvc_build(glusterd_svc_t *svc);
-
-int
-glusterd_tierdsvc_init(void *data);
-
-int
-glusterd_tierdsvc_manager(glusterd_svc_t *svc, void *data, int flags);
-
-int
-glusterd_tierdsvc_start(glusterd_svc_t *svc, int flags);
-
-int
-glusterd_tierdsvc_reconfigure(void *data);
-
-int
-glusterd_tierdsvc_restart();
-
-#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index a9714f03543..a1a45e97502 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -251,53 +251,9 @@ glusterd_volume_brick_for_each(glusterd_volinfo_t *volinfo, void *data,
glusterd_brickinfo_t *,
dict_t *mod_dict, void *))
{
- dict_t *mod_dict = NULL;
- glusterd_volinfo_t *dup_volinfo = NULL;
- int ret = 0;
-
gd_set_shared_brick_count(volinfo);
- if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
- ret = _brick_for_each(volinfo, NULL, data, fn);
- if (ret)
- goto out;
- } else {
- ret = glusterd_create_sub_tier_volinfo(volinfo, &dup_volinfo, _gf_true,
- volinfo->volname);
- if (ret)
- goto out;
-
- mod_dict = dict_new();
- if (!mod_dict) {
- ret = -1;
- goto out;
- }
-
- ret = dict_set_nstrn(mod_dict, "hot-brick", SLEN("hot-brick"), "on",
- SLEN("on"));
- if (ret)
- goto out;
-
- ret = _brick_for_each(dup_volinfo, mod_dict, data, fn);
- if (ret)
- goto out;
- GF_FREE(dup_volinfo);
- dup_volinfo = NULL;
- ret = glusterd_create_sub_tier_volinfo(volinfo, &dup_volinfo, _gf_false,
- volinfo->volname);
- if (ret)
- goto out;
- ret = _brick_for_each(dup_volinfo, NULL, data, fn);
- if (ret)
- goto out;
- }
-out:
- if (dup_volinfo)
- glusterd_volinfo_delete(dup_volinfo);
-
- if (mod_dict)
- dict_unref(mod_dict);
- return ret;
+ return _brick_for_each(volinfo, NULL, data, fn);
}
int32_t
@@ -694,7 +650,6 @@ glusterd_volinfo_new(glusterd_volinfo_t **volinfo)
new_volinfo->xl = THIS;
glusterd_snapdsvc_build(&new_volinfo->snapd.svc);
- glusterd_tierdsvc_build(&new_volinfo->tierd.svc);
glusterd_gfproxydsvc_build(&new_volinfo->gfproxyd.svc);
glusterd_shdsvc_build(&new_volinfo->shd.svc);
@@ -751,7 +706,6 @@ glusterd_volinfo_dup(glusterd_volinfo_t *volinfo,
new_volinfo->subvol_count = volinfo->subvol_count;
new_volinfo->transport_type = volinfo->transport_type;
new_volinfo->brick_count = volinfo->brick_count;
- new_volinfo->tier_info = volinfo->tier_info;
new_volinfo->quota_conf_version = volinfo->quota_conf_version;
new_volinfo->quota_xattr_version = volinfo->quota_xattr_version;
new_volinfo->snap_max_hard_limit = volinfo->snap_max_hard_limit;
@@ -827,90 +781,6 @@ glusterd_brickinfo_dup(glusterd_brickinfo_t *brickinfo,
out:
return ret;
}
-int32_t
-glusterd_create_sub_tier_volinfo(glusterd_volinfo_t *volinfo,
- glusterd_volinfo_t **dup_volinfo,
- gf_boolean_t is_hot_tier,
- const char *new_volname)
-{
- glusterd_brickinfo_t *brickinfo = NULL;
- glusterd_brickinfo_t *brickinfo_dup = NULL;
- gd_tier_info_t *tier_info = NULL;
- int i = 0;
- int ret = -1;
-
- tier_info = &(volinfo->tier_info);
-
- ret = glusterd_volinfo_dup(volinfo, dup_volinfo, _gf_true);
- if (ret) {
- gf_msg("glusterd", GF_LOG_ERROR, 0, GD_MSG_VOL_OP_FAILED,
- "Failed to create volinfo");
- return ret;
- }
-
- gf_uuid_copy((*dup_volinfo)->volume_id, volinfo->volume_id);
- (*dup_volinfo)->is_snap_volume = volinfo->is_snap_volume;
- (*dup_volinfo)->status = volinfo->status;
- (*dup_volinfo)->snapshot = volinfo->snapshot;
-
- if (snprintf((*dup_volinfo)->volname, sizeof((*dup_volinfo)->volname), "%s",
- new_volname) >= sizeof((*dup_volinfo)->volname)) {
- ret = -1;
- goto out;
- }
-
- memcpy(&(*dup_volinfo)->tier_info, &volinfo->tier_info,
- sizeof(volinfo->tier_info));
-
- cds_list_for_each_entry(brickinfo, &volinfo->bricks, brick_list)
- {
- i++;
-
- if (is_hot_tier) {
- if (i > volinfo->tier_info.hot_brick_count)
- break;
- } else {
- if (i <= volinfo->tier_info.hot_brick_count)
- continue;
- }
-
- ret = glusterd_brickinfo_new(&brickinfo_dup);
- if (ret) {
- gf_msg("glusterd", GF_LOG_ERROR, 0, GD_MSG_BRICK_NEW_INFO_FAIL,
- "Failed to create "
- "new brickinfo");
- goto out;
- }
-
- glusterd_brickinfo_dup(brickinfo, brickinfo_dup);
- cds_list_add_tail(&brickinfo_dup->brick_list,
- &((*dup_volinfo)->bricks));
- }
-
- if (is_hot_tier) {
- (*dup_volinfo)->type = tier_info->hot_type;
- (*dup_volinfo)->replica_count = tier_info->hot_replica_count;
- (*dup_volinfo)->brick_count = tier_info->hot_brick_count;
- (*dup_volinfo)->dist_leaf_count = glusterd_get_dist_leaf_count(
- *dup_volinfo);
-
- } else {
- (*dup_volinfo)->type = tier_info->cold_type;
- (*dup_volinfo)->replica_count = tier_info->cold_replica_count;
- (*dup_volinfo)->disperse_count = tier_info->cold_disperse_count;
- (*dup_volinfo)->redundancy_count = tier_info->cold_redundancy_count;
- (*dup_volinfo)->dist_leaf_count = tier_info->cold_dist_leaf_count;
- (*dup_volinfo)->brick_count = tier_info->cold_brick_count;
- }
-out:
- /* coverity[REVERSE_NULL] */
- if (ret && *dup_volinfo) {
- glusterd_volinfo_delete(*dup_volinfo);
- *dup_volinfo = NULL;
- }
-
- return ret;
-}
/*
* gd_vol_is_geo_rep_active:
@@ -1054,7 +924,6 @@ glusterd_volinfo_delete(glusterd_volinfo_t *volinfo)
/* Destroy the connection object for per volume svc daemons */
glusterd_conn_term(&volinfo->snapd.svc.conn);
- glusterd_conn_term(&volinfo->tierd.svc.conn);
glusterd_conn_term(&volinfo->gfproxyd.svc.conn);
gf_store_handle_destroy(volinfo->quota_conf_shandle);
@@ -3034,58 +2903,6 @@ glusterd_add_volume_to_dict(glusterd_volinfo_t *volinfo, dict_t *dict,
if (ret)
goto out;
- /* tiering related variables */
-
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- snprintf(key, sizeof(key), "%s.cold_brick_count", pfx);
- ret = dict_set_uint32(dict, key, volinfo->tier_info.cold_brick_count);
- if (ret)
- goto out;
-
- snprintf(key, sizeof(key), "%s.cold_type", pfx);
- ret = dict_set_uint32(dict, key, volinfo->tier_info.cold_type);
- if (ret)
- goto out;
-
- snprintf(key, sizeof(key), "%s.cold_replica_count", pfx);
- ret = dict_set_uint32(dict, key, volinfo->tier_info.cold_replica_count);
- if (ret)
- goto out;
-
- snprintf(key, sizeof(key), "%s.cold_disperse_count", pfx);
- ret = dict_set_uint32(dict, key,
- volinfo->tier_info.cold_disperse_count);
- if (ret)
- goto out;
-
- snprintf(key, sizeof(key), "%s.cold_redundancy_count", pfx);
- ret = dict_set_uint32(dict, key,
- volinfo->tier_info.cold_redundancy_count);
- if (ret)
- goto out;
-
- snprintf(key, sizeof(key), "%s.cold_dist_count", pfx);
- ret = dict_set_uint32(dict, key,
- volinfo->tier_info.cold_dist_leaf_count);
- if (ret)
- goto out;
-
- snprintf(key, sizeof(key), "%s.hot_brick_count", pfx);
- ret = dict_set_uint32(dict, key, volinfo->tier_info.hot_brick_count);
- if (ret)
- goto out;
-
- snprintf(key, sizeof(key), "%s.hot_type", pfx);
- ret = dict_set_uint32(dict, key, volinfo->tier_info.hot_type);
- if (ret)
- goto out;
-
- snprintf(key, sizeof(key), "%s.hot_replica_count", pfx);
- ret = dict_set_uint32(dict, key, volinfo->tier_info.hot_replica_count);
- if (ret)
- goto out;
- }
-
ret = gd_add_vol_snap_details_to_dict(dict, pfx, volinfo);
if (ret)
goto out;
@@ -3737,7 +3554,6 @@ glusterd_spawn_daemons(void *opaque)
glusterd_restart_gsyncds(conf);
glusterd_restart_rebalance(conf);
ret = glusterd_snapdsvc_restart();
- ret = glusterd_tierdsvc_restart();
ret = glusterd_gfproxydsvc_restart();
ret = glusterd_shdsvc_restart();
return ret;
@@ -4266,78 +4082,6 @@ glusterd_import_volinfo(dict_t *peer_data, int count,
gf_msg(THIS->name, GF_LOG_INFO, 0, GD_MSG_DICT_GET_FAILED,
"peer is possibly old version");
- /* not having a 'hot_brick_count' key is not a error
- (as peer may be of old version) */
- keylen = snprintf(key, sizeof(key), "%s.hot_brick_count", key_prefix);
- ret = dict_get_int32n(peer_data, key, keylen,
- &new_volinfo->tier_info.hot_brick_count);
- if (ret)
- gf_msg_debug(THIS->name, 0, "peer is possibly old version");
-
- /* not having a 'hot_type' key is not a error
- (as peer may be of old version) */
- keylen = snprintf(key, sizeof(key), "%s.hot_type", key_prefix);
- ret = dict_get_int32n(peer_data, key, keylen,
- &new_volinfo->tier_info.hot_type);
- if (ret)
- gf_msg_debug(THIS->name, 0, "peer is possibly old version");
-
- /* not having a 'hot_replica_count' key is not a error
- (as peer may be of old version) */
- keylen = snprintf(key, sizeof(key), "%s.hot_replica_count", key_prefix);
- ret = dict_get_int32n(peer_data, key, keylen,
- &new_volinfo->tier_info.hot_replica_count);
- if (ret)
- gf_msg_debug(THIS->name, 0, "peer is possibly old version");
-
- /* not having a 'cold_brick_count' key is not a error
- (as peer may be of old version) */
- keylen = snprintf(key, sizeof(key), "%s.cold_brick_count", key_prefix);
- ret = dict_get_int32n(peer_data, key, keylen,
- &new_volinfo->tier_info.cold_brick_count);
- if (ret)
- gf_msg_debug(THIS->name, 0, "peer is possibly old version");
-
- /* not having a 'cold_type' key is not a error
- (as peer may be of old version) */
- keylen = snprintf(key, sizeof(key), "%s.cold_type", key_prefix);
- ret = dict_get_int32n(peer_data, key, keylen,
- &new_volinfo->tier_info.cold_type);
- if (ret)
- gf_msg_debug(THIS->name, 0, "peer is possibly old version");
-
- /* not having a 'cold_replica_count' key is not a error
- (as peer may be of old version) */
- keylen = snprintf(key, sizeof(key), "%s.cold_replica_count", key_prefix);
- ret = dict_get_int32n(peer_data, key, keylen,
- &new_volinfo->tier_info.cold_replica_count);
- if (ret)
- gf_msg_debug(THIS->name, 0, "peer is possibly old version");
-
- /* not having a 'cold_disperse_count' key is not a error
- (as peer may be of old version) */
- keylen = snprintf(key, sizeof(key), "%s.cold_disperse_count", key_prefix);
- ret = dict_get_int32n(peer_data, key, keylen,
- &new_volinfo->tier_info.cold_disperse_count);
- if (ret)
- gf_msg_debug(THIS->name, 0, "peer is possibly old version");
-
- /* not having a 'cold_redundancy_count' key is not a error
- (as peer may be of old version) */
- keylen = snprintf(key, sizeof(key), "%s.cold_redundancy_count", key_prefix);
- ret = dict_get_int32n(peer_data, key, keylen,
- &new_volinfo->tier_info.cold_redundancy_count);
- if (ret)
- gf_msg_debug(THIS->name, 0, "peer is possibly old version");
-
- /* not having a 'cold_dist_count' key is not a error
- (as peer may be of old version) */
- keylen = snprintf(key, sizeof(key), "%s.cold_dist_count", key_prefix);
- ret = dict_get_int32n(peer_data, key, keylen,
- &new_volinfo->tier_info.cold_dist_leaf_count);
- if (ret)
- gf_msg_debug(THIS->name, 0, "peer is possibly old version");
-
new_volinfo->subvol_count = new_volinfo->brick_count /
glusterd_get_dist_leaf_count(new_volinfo);
snprintf(key, sizeof(key), "%s.ckusm", key_prefix);
@@ -5183,9 +4927,6 @@ glusterd_pending_node_get_rpc(glusterd_pending_node_t *pending_node)
} else if (pending_node->type == GD_NODE_SNAPD) {
volinfo = pending_node->node;
rpc = volinfo->snapd.svc.conn.rpc;
- } else if (pending_node->type == GD_NODE_TIERD) {
- volinfo = pending_node->node;
- rpc = volinfo->tierd.svc.conn.rpc;
} else {
GF_ASSERT(0);
}
@@ -5205,10 +4946,6 @@ glusterd_pending_node_put_rpc(glusterd_pending_node_t *pending_node)
glusterd_defrag_rpc_put(volinfo->rebal.defrag);
break;
- case GD_NODE_TIERD:
- volinfo = pending_node->node;
- glusterd_defrag_rpc_put(volinfo->tier.defrag);
- break;
default:
break;
}
@@ -7580,32 +7317,9 @@ out:
return ret;
}
-gf_boolean_t
-glusterd_is_tier_daemon_running(glusterd_volinfo_t *volinfo)
-{
- if (volinfo->type != GF_CLUSTER_TYPE_TIER)
- return _gf_false;
-
- if (volinfo->rebal.defrag &&
- volinfo->rebal.defrag_cmd == GF_DEFRAG_CMD_START_TIER) {
- return _gf_true;
- }
-
- return _gf_false;
-}
-
int
glusterd_is_defrag_on(glusterd_volinfo_t *volinfo)
{
- /*
- * Do not need to consider tier daemon as a rebalance
- * daemon and with current design rebalance is not supported
- * on a tiered volume.
- */
-
- if (glusterd_is_tier_daemon_running(volinfo))
- return 0;
-
return (volinfo->rebal.defrag != NULL);
}
@@ -8417,12 +8131,6 @@ glusterd_is_replica_volume(int type)
gf_boolean_t
glusterd_is_volume_replicate(glusterd_volinfo_t *volinfo)
{
- gf_boolean_t replicates = _gf_false;
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- replicates = glusterd_is_replica_volume(volinfo->tier_info.cold_type) |
- glusterd_is_replica_volume(volinfo->tier_info.hot_type);
- return replicates;
- }
return glusterd_is_replica_volume((volinfo->type));
}
@@ -8440,13 +8148,6 @@ glusterd_is_shd_compatible_type(int type)
gf_boolean_t
glusterd_is_shd_compatible_volume(glusterd_volinfo_t *volinfo)
{
- int ret = 0;
-
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- ret = glusterd_is_shd_compatible_type(volinfo->tier_info.cold_type) |
- glusterd_is_shd_compatible_type(volinfo->tier_info.hot_type);
- return ret;
- }
return glusterd_is_shd_compatible_type(volinfo->type);
}
@@ -8940,16 +8641,6 @@ glusterd_friend_remove_cleanup_vols(uuid_t uuid)
"to stop shd daemon service");
}
}
-
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- svc = &(volinfo->tierd.svc);
- ret = svc->stop(svc, SIGTERM);
- if (ret) {
- gf_msg(THIS->name, GF_LOG_ERROR, 0, GD_MSG_SVC_STOP_FAIL,
- "Failed "
- "to stop tierd daemon service");
- }
- }
}
if (glusterd_friend_contains_vol_bricks(volinfo, uuid) == 2) {
@@ -9067,32 +8758,6 @@ glusterd_get_trusted_client_filepath(char *filepath,
return ret;
}
-void
-glusterd_update_tier_status(glusterd_volinfo_t *volinfo)
-{
- glusterd_rebalance_t *rebal = NULL;
-
- rebal = &volinfo->rebal;
-
- if (volinfo->type != GF_CLUSTER_TYPE_TIER)
- return;
-
- /*
- * If tier process status is stopped or failed, then
- * manually changing the status.
- */
-
- switch (rebal->defrag_status) {
- case GF_DEFRAG_STATUS_FAILED:
- case GF_DEFRAG_STATUS_STOPPED:
- rebal->defrag_status = GF_DEFRAG_STATUS_STARTED;
- break;
- default:
- break;
- }
- return;
-}
-
int
glusterd_get_dummy_client_filepath(char *filepath, glusterd_volinfo_t *volinfo,
gf_transport_type type)
@@ -9141,12 +8806,6 @@ glusterd_volume_defrag_restart(glusterd_volinfo_t *volinfo, char *op_errstr,
* start the rebalance process
*/
- /*
- * Changing the status of tier process to start the daemon
- * forcefully.
- */
- glusterd_update_tier_status(volinfo);
-
switch (volinfo->rebal.defrag_status) {
case GF_DEFRAG_STATUS_COMPLETE:
case GF_DEFRAG_STATUS_STOPPED:
@@ -9252,9 +8911,6 @@ glusterd_restart_rebalance_for_volume(glusterd_volinfo_t *volinfo)
* work correctly.
*/
volinfo->rebal.defrag_status = GF_DEFRAG_STATUS_NOT_STARTED;
- if (volinfo->type == GF_CLUSTER_TYPE_TIER)
- glusterd_store_perform_node_state_store(volinfo);
-
return 0;
}
if (!volinfo->rebal.defrag_cmd) {
@@ -9428,44 +9084,22 @@ glusterd_defrag_volume_status_update(glusterd_volinfo_t *volinfo,
if (ret2)
gf_msg_trace(this->name, 0, "failed to get time left");
- if (cmd == GF_DEFRAG_CMD_STATUS_TIER) {
- if (files)
- volinfo->tier.rebalance_files = files;
- if (size)
- volinfo->tier.rebalance_data = size;
- if (lookup)
- volinfo->tier.lookedup_files = lookup;
- if (status)
- volinfo->tier.defrag_status = status;
- if (failures)
- volinfo->tier.rebalance_failures = failures;
- if (skipped)
- volinfo->tier.skipped_files = skipped;
- if (run_time)
- volinfo->tier.rebalance_time = run_time;
- } else {
- if (files)
- volinfo->rebal.rebalance_files = files;
- if (size)
- volinfo->rebal.rebalance_data = size;
- if (lookup)
- volinfo->rebal.lookedup_files = lookup;
- if (status)
- volinfo->rebal.defrag_status = status;
- if (failures)
- volinfo->rebal.rebalance_failures = failures;
- if (skipped)
- volinfo->rebal.skipped_files = skipped;
- if (run_time)
- volinfo->rebal.rebalance_time = run_time;
- if (!ret2)
- volinfo->rebal.time_left = time_left;
- }
-
- if (promoted)
- volinfo->tier_info.promoted = promoted;
- if (demoted)
- volinfo->tier_info.demoted = demoted;
+ if (files)
+ volinfo->rebal.rebalance_files = files;
+ if (size)
+ volinfo->rebal.rebalance_data = size;
+ if (lookup)
+ volinfo->rebal.lookedup_files = lookup;
+ if (status)
+ volinfo->rebal.defrag_status = status;
+ if (failures)
+ volinfo->rebal.rebalance_failures = failures;
+ if (skipped)
+ volinfo->rebal.skipped_files = skipped;
+ if (run_time)
+ volinfo->rebal.rebalance_time = run_time;
+ if (!ret2)
+ volinfo->rebal.time_left = time_left;
return ret;
}
@@ -10396,23 +10030,6 @@ glusterd_volume_status_copy_to_op_ctx_dict(dict_t *aggr, dict_t *rsp_dict)
goto out;
}
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- ret = dict_get_int32n(rsp_dict, "hot_brick_count",
- SLEN("hot_brick_count"), &hot_brick_count);
- if (ret) {
- gf_msg(THIS->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "Failed to get hot brick count from rsp_dict");
- goto out;
- }
-
- ret = dict_get_int32n(rsp_dict, "type", SLEN("type"), &type);
- if (ret) {
- gf_msg(THIS->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
- "Failed to get type from rsp_dict");
- goto out;
- }
- }
-
ret = dict_set_int32n(ctx_dict, "hot_brick_count", SLEN("hot_brick_count"),
hot_brick_count);
if (ret) {
@@ -11131,189 +10748,6 @@ out:
}
int
-glusterd_volume_tier_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict)
-{
- char key[64] = "";
- int keylen;
- char *node_uuid = NULL;
- char *node_uuid_str = NULL;
- char *volname = NULL;
- dict_t *ctx_dict = NULL;
- double elapsed_time = 0;
- glusterd_volinfo_t *volinfo = NULL;
- int ret = 0;
- int32_t index = 0;
- int32_t count = 0;
- int32_t value32 = 0;
- uint64_t value = 0;
- xlator_t *this = NULL;
- char *task_id_str = NULL;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO("glusterd", this, out);
- GF_VALIDATE_OR_GOTO(this->name, rsp_dict, out);
-
- if (aggr) {
- ctx_dict = aggr;
-
- } else {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_OPCTX_GET_FAIL,
- "Operation Context is not present");
- goto out;
- }
-
- ret = dict_get_strn(ctx_dict, "volname", SLEN("volname"), &volname);
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_GET_FAILED,
- "Unable to get volume name");
- goto out;
- }
-
- ret = glusterd_volinfo_find(volname, &volinfo);
-
- if (ret)
- goto out;
-
- ret = dict_get_int32n(rsp_dict, "count", SLEN("count"), &index);
- if (ret)
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_GET_FAILED,
- "failed to get index");
-
- keylen = snprintf(key, sizeof(key), "node-uuid-%d", index);
- ret = dict_get_strn(rsp_dict, key, keylen, &node_uuid);
- if (!ret) {
- node_uuid_str = gf_strdup(node_uuid);
- }
- ret = dict_get_int32n(ctx_dict, "count", SLEN("count"), &count);
- count++;
- ret = dict_set_int32n(ctx_dict, "count", SLEN("count"), count);
- if (ret)
- gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
- "Failed to set count");
-
- keylen = snprintf(key, sizeof(key), "node-uuid-%d", count);
- ret = dict_set_dynstrn(ctx_dict, key, keylen, node_uuid_str);
- if (ret) {
- gf_msg_debug(this->name, 0, "failed to set node-uuid");
- }
-
- snprintf(key, sizeof(key), "files-%d", index);
- ret = dict_get_uint64(rsp_dict, key, &value);
- if (!ret) {
- snprintf(key, sizeof(key), "files-%d", count);
- ret = dict_set_uint64(ctx_dict, key, value);
- if (ret) {
- gf_msg_debug(this->name, 0, "failed to set the file count");
- }
- }
-
- snprintf(key, sizeof(key), "size-%d", index);
- ret = dict_get_uint64(rsp_dict, key, &value);
- if (!ret) {
- snprintf(key, sizeof(key), "size-%d", count);
- ret = dict_set_uint64(ctx_dict, key, value);
- if (ret) {
- gf_msg_debug(this->name, 0, "failed to set the size of migration");
- }
- }
-
- snprintf(key, sizeof(key), "lookups-%d", index);
- ret = dict_get_uint64(rsp_dict, key, &value);
- if (!ret) {
- snprintf(key, sizeof(key), "lookups-%d", count);
- ret = dict_set_uint64(ctx_dict, key, value);
- if (ret) {
- gf_msg_debug(this->name, 0, "failed to set looked up file count");
- }
- }
-
- keylen = snprintf(key, sizeof(key), "status-%d", index);
- ret = dict_get_int32n(rsp_dict, key, keylen, &value32);
- if (!ret) {
- keylen = snprintf(key, sizeof(key), "status-%d", count);
- ret = dict_set_int32n(ctx_dict, key, keylen, value32);
- if (ret) {
- gf_msg_debug(this->name, 0, "failed to set status");
- }
- }
-
- snprintf(key, sizeof(key), "failures-%d", index);
- ret = dict_get_uint64(rsp_dict, key, &value);
- if (!ret) {
- snprintf(key, sizeof(key), "failures-%d", count);
- ret = dict_set_uint64(ctx_dict, key, value);
- if (ret) {
- gf_msg_debug(this->name, 0, "failed to set failure count");
- }
- }
-
- snprintf(key, sizeof(key), "skipped-%d", index);
- ret = dict_get_uint64(rsp_dict, key, &value);
- if (!ret) {
- snprintf(key, sizeof(key), "skipped-%d", count);
- ret = dict_set_uint64(ctx_dict, key, value);
- if (ret) {
- gf_msg_debug(this->name, 0, "failed to set skipped count");
- }
- }
- snprintf(key, sizeof(key), "run-time-%d", index);
- ret = dict_get_double(rsp_dict, key, &elapsed_time);
- if (!ret) {
- snprintf(key, sizeof(key), "run-time-%d", count);
- ret = dict_set_double(ctx_dict, key, elapsed_time);
- if (ret) {
- gf_msg_debug(this->name, 0, "failed to set run-time");
- }
- }
-
- snprintf(key, sizeof(key), "demoted-%d", index);
- ret = dict_get_uint64(rsp_dict, key, &value);
- if (!ret) {
- snprintf(key, sizeof(key), "demoted-%d", count);
- ret = dict_set_uint64(ctx_dict, key, value);
- if (ret) {
- gf_msg_debug(this->name, 0, "failed to set demoted count");
- }
- }
- snprintf(key, sizeof(key), "promoted-%d", index);
- ret = dict_get_uint64(rsp_dict, key, &value);
- if (!ret) {
- snprintf(key, sizeof(key), "promoted-%d", count);
- ret = dict_set_uint64(ctx_dict, key, value);
- if (ret) {
- gf_msg_debug(this->name, 0, "failed to set promoted count");
- }
- }
-
- snprintf(key, sizeof(key), "time-left-%d", index);
- ret = dict_get_uint64(rsp_dict, key, &value);
- if (!ret) {
- snprintf(key, sizeof(key), "time-left-%d", count);
- ret = dict_set_uint64(ctx_dict, key, value);
- if (ret) {
- gf_msg_debug(THIS->name, 0, "failed to set time-left");
- }
- }
-
- ret = dict_get_strn(rsp_dict, GF_REMOVE_BRICK_TID_KEY,
- SLEN(GF_REMOVE_BRICK_TID_KEY), &task_id_str);
- if (ret) {
- gf_msg_debug(this->name, errno, "Missing remove-brick-id");
- } else {
- ret = dict_set_strn(ctx_dict, GF_REMOVE_BRICK_TID_KEY,
- SLEN(GF_REMOVE_BRICK_TID_KEY), task_id_str);
- if (ret)
- gf_msg_debug(this->name, errno,
- "Failed to set remove brick task ID");
- }
-
- ret = 0;
-
-out:
- return ret;
-}
-
-int
glusterd_sys_exec_output_rsp_dict(dict_t *dst, dict_t *src)
{
char output_name[64] = "";
@@ -11843,7 +11277,6 @@ glusterd_status_volume_client_list(dict_t *rsp_dict, dict_t *op_ctx,
int32_t count = 0;
int32_t fuse_count = 0;
int32_t gfapi_count = 0;
- int32_t tierd_count = 0;
int32_t rebalance_count = 0;
int32_t glustershd_count = 0;
int32_t quotad_count = 0;
@@ -11902,15 +11335,6 @@ glusterd_status_volume_client_list(dict_t *rsp_dict, dict_t *op_ctx,
gfapi_count++;
continue;
- } else if (!strcmp(process, "tierd")) {
- ret = dict_get_int32n(op_ctx, "tierd-count", SLEN("tierd-count"),
- &count);
- if (ret) {
- gf_msg(THIS->name, GF_LOG_INFO, 0, GD_MSG_DICT_GET_FAILED,
- "Couldn't get tierd-count");
- }
- tierd_count++;
- continue;
} else if (!strcmp(process, "rebalance")) {
ret = dict_get_int32n(op_ctx, "rebalance-count",
SLEN("rebalance-count"), &count);
@@ -11967,15 +11391,6 @@ glusterd_status_volume_client_list(dict_t *rsp_dict, dict_t *op_ctx,
goto out;
}
}
- if (tierd_count) {
- ret = dict_set_int32n(op_ctx, "tierd-count", SLEN("tierd-count"),
- tierd_count);
- if (ret) {
- gf_msg(THIS->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
- "Couldn't set tierd-count");
- goto out;
- }
- }
if (rebalance_count) {
ret = dict_set_int32n(op_ctx, "rebalance-count",
SLEN("rebalance-count"), rebalance_count);
@@ -12018,8 +11433,7 @@ out:
}
int
-glusterd_tier_or_rebalance_rsp(dict_t *op_ctx, glusterd_rebalance_t *index,
- int32_t i)
+glusterd_rebalance_rsp(dict_t *op_ctx, glusterd_rebalance_t *index, int32_t i)
{
int ret = 0;
char key[64] = "";
@@ -12129,10 +11543,7 @@ glusterd_defrag_volume_node_rsp(dict_t *req_dict, dict_t *rsp_dict,
gf_msg(THIS->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
"failed to set node-uuid");
- if (cmd == GF_DEFRAG_CMD_STATUS_TIER)
- glusterd_tier_or_rebalance_rsp(op_ctx, &volinfo->tier, i);
- else
- glusterd_tier_or_rebalance_rsp(op_ctx, &volinfo->rebal, i);
+ glusterd_rebalance_rsp(op_ctx, &volinfo->rebal, i);
snprintf(key, sizeof(key), "time-left-%d", i);
ret = dict_set_uint64(op_ctx, key, volinfo->rebal.time_left);
@@ -12140,18 +11551,6 @@ glusterd_defrag_volume_node_rsp(dict_t *req_dict, dict_t *rsp_dict,
gf_msg(THIS->name, GF_LOG_ERROR, errno, GD_MSG_DICT_SET_FAILED,
"failed to set time left");
- snprintf(key, sizeof(key), "promoted-%d", i);
- ret = dict_set_uint64(op_ctx, key, volinfo->tier_info.promoted);
- if (ret)
- gf_msg(THIS->name, GF_LOG_ERROR, errno, GD_MSG_DICT_SET_FAILED,
- "failed to set lookedup file count");
-
- snprintf(key, sizeof(key), "demoted-%d", i);
- ret = dict_set_uint64(op_ctx, key, volinfo->tier_info.demoted);
- if (ret)
- gf_msg(THIS->name, GF_LOG_ERROR, errno, GD_MSG_DICT_SET_FAILED,
- "failed to set lookedup file count");
-
out:
return ret;
}
@@ -12179,8 +11578,6 @@ glusterd_handle_node_rsp(dict_t *req_dict, void *pending_entry,
ret = glusterd_status_volume_brick_rsp(rsp_dict, op_ctx,
op_errstr);
break;
- case GD_OP_TIER_STATUS:
- case GD_OP_DETACH_TIER_STATUS:
case GD_OP_DEFRAG_BRICK_VOLUME:
glusterd_defrag_volume_node_rsp(req_dict, rsp_dict, op_ctx);
break;
@@ -12540,22 +11937,6 @@ glusterd_is_volume_inode_quota_enabled(glusterd_volinfo_t *volinfo)
}
int
-glusterd_is_tierd_supposed_to_be_enabled(glusterd_volinfo_t *volinfo)
-{
- if ((volinfo->type != GF_CLUSTER_TYPE_TIER) ||
- (volinfo->tier.op == GD_OP_DETACH_TIER))
- return _gf_false;
- else
- return _gf_true;
-}
-
-int
-glusterd_is_tierd_enabled(glusterd_volinfo_t *volinfo)
-{
- return volinfo->is_tier_enabled;
-}
-
-int
glusterd_is_bitrot_enabled(glusterd_volinfo_t *volinfo)
{
return glusterd_volinfo_get_boolean(volinfo, VKEY_FEATURES_BITROT);
@@ -12921,22 +12302,6 @@ glusterd_enable_default_options(glusterd_volinfo_t *volinfo, char *option)
}
}
}
-
- if (!option || !strcmp("features.ctr-enabled", option)) {
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- ret = dict_set_dynstr_with_alloc(volinfo->dict,
- "features.ctr-enabled", "on");
- if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, errno,
- GD_MSG_DICT_SET_FAILED,
- "Failed to set option "
- "'features.ctr-enabled' "
- "on volume %s",
- volinfo->volname);
- goto out;
- }
- }
- }
}
out:
return ret;
@@ -13791,52 +13156,6 @@ out:
return ret;
}
-int
-glusterd_volume_get_hot_tier_type_str(glusterd_volinfo_t *volinfo,
- char **hot_tier_type_str)
-{
- int ret = -1;
- int hot_tier_type = 0;
- int hot_dist_count = 0;
-
- GF_VALIDATE_OR_GOTO(THIS->name, volinfo, out);
- GF_VALIDATE_OR_GOTO(THIS->name, hot_tier_type_str, out);
-
- hot_dist_count = volinfo->tier_info.hot_replica_count
- ? volinfo->tier_info.hot_replica_count
- : 1;
-
- hot_tier_type = get_vol_type(volinfo->tier_info.hot_type, hot_dist_count,
- volinfo->tier_info.hot_brick_count);
-
- *hot_tier_type_str = vol_type_str[hot_tier_type];
-
- ret = 0;
-out:
- return ret;
-}
-
-int
-glusterd_volume_get_cold_tier_type_str(glusterd_volinfo_t *volinfo,
- char **cold_tier_type_str)
-{
- int ret = -1;
- int cold_tier_type = 0;
-
- GF_VALIDATE_OR_GOTO(THIS->name, volinfo, out);
- GF_VALIDATE_OR_GOTO(THIS->name, cold_tier_type_str, out);
-
- cold_tier_type = get_vol_type(volinfo->tier_info.cold_type,
- volinfo->tier_info.cold_dist_leaf_count,
- volinfo->tier_info.cold_brick_count);
-
- *cold_tier_type_str = vol_type_str[cold_tier_type];
-
- ret = 0;
-out:
- return ret;
-}
-
/* This function will insert the element to the list in a order.
Order will be based on the compare function provided as a input.
If element to be inserted in ascending order compare should return:
@@ -13859,79 +13178,6 @@ glusterd_list_add_order(struct cds_list_head *new, struct cds_list_head *head,
cds_list_add_rcu(new, rcu_dereference(pos->prev));
}
-int
-glusterd_disallow_op_for_tier(glusterd_volinfo_t *volinfo, glusterd_op_t op,
- int cmd)
-{
- xlator_t *this = NULL;
- int ret = 0;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO(this->name, volinfo, out);
-
- if (volinfo->type != GF_CLUSTER_TYPE_TIER)
- goto out;
-
- switch (op) {
- case GD_OP_ADD_BRICK:
- case GD_OP_REPLACE_BRICK:
- case GD_OP_RESET_BRICK:
- ret = -1;
- gf_msg_debug(this->name, 0,
- "Operation not "
- "permitted on tiered volume %s",
- volinfo->volname);
- break;
- case GD_OP_REBALANCE:
- switch (cmd) {
- case GF_DEFRAG_CMD_START_TIER:
- case GF_DEFRAG_CMD_STATUS_TIER:
- case GF_DEFRAG_CMD_START_DETACH_TIER:
- case GF_DEFRAG_CMD_STOP_DETACH_TIER:
- case GF_DEFRAG_CMD_STATUS:
- case GF_DEFRAG_CMD_DETACH_STATUS:
- case GF_DEFRAG_CMD_STOP_TIER:
- case GF_DEFRAG_CMD_DETACH_START:
- case GF_DEFRAG_CMD_DETACH_COMMIT:
- case GF_DEFRAG_CMD_DETACH_COMMIT_FORCE:
- case GF_DEFRAG_CMD_DETACH_STOP:
- ret = 0;
- break;
- default:
- gf_msg_debug(this->name, 0,
- "Rebalance Operation not permitted"
- " on tiered volume %s",
- volinfo->volname);
- ret = -1;
- break;
- }
- break;
- case GD_OP_REMOVE_BRICK:
- switch (cmd) {
- /* coverity[MIXED_ENUMS] */
- case GF_DEFRAG_CMD_DETACH_START:
- case GF_OP_CMD_DETACH_COMMIT_FORCE:
- case GF_OP_CMD_DETACH_COMMIT:
- case GF_OP_CMD_DETACH_START:
- case GF_DEFRAG_CMD_STOP_DETACH_TIER:
- ret = 0;
- break;
- default:
- gf_msg_debug(this->name, 0,
- "Remove brick operation not "
- "permitted on tiered volume %s",
- volinfo->volname);
- ret = -1;
- break;
- }
- break;
- default:
- break;
- }
-out:
- return ret;
-}
-
int32_t
glusterd_count_connected_peers(int32_t *count)
{
@@ -14248,17 +13494,6 @@ glusterd_brick_op_prerequisites(dict_t *dict, char **op, glusterd_op_t *gd_op,
goto out;
}
- ret = glusterd_disallow_op_for_tier(*volinfo, *gd_op, -1);
- if (ret) {
- snprintf(msg, sizeof(msg),
- "%sbrick commands are not "
- "supported on tiered volume %s",
- (*gd_op == GD_OP_REPLACE_BRICK) ? "replace-" : "reset-",
- *volname);
- *op_errstr = gf_strdup(msg);
- goto out;
- }
-
/* If geo-rep is configured, for this volume, it should be stopped. */
param.volinfo = *volinfo;
ret = glusterd_check_geo_rep_running(&param, op_errstr);
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h
index ae4bc5e8ecf..9679c8b80db 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.h
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.h
@@ -284,17 +284,6 @@ int
glusterd_brick_stop(glusterd_volinfo_t *volinfo,
glusterd_brickinfo_t *brickinfo, gf_boolean_t del_brick);
-gf_boolean_t
-glusterd_is_tier_daemon_running(glusterd_volinfo_t *volinfo);
-
-int32_t
-glusterd_add_tierd_to_dict(glusterd_volinfo_t *volinfo, dict_t *dict,
- int32_t count);
-
-int
-glusterd_op_tier_status(dict_t *dict, char **op_errstr, dict_t *rsp_dict,
- glusterd_op_t op);
-
int
glusterd_is_defrag_on(glusterd_volinfo_t *volinfo);
@@ -441,11 +430,6 @@ glusterd_get_trusted_client_filepath(char *filepath,
int
glusterd_restart_rebalance(glusterd_conf_t *conf);
-int32_t
-glusterd_create_sub_tier_volinfo(glusterd_volinfo_t *volinfo,
- glusterd_volinfo_t **dup_volinfo,
- gf_boolean_t is_hot_tier,
- const char *new_name);
int
glusterd_restart_rebalance_for_volume(glusterd_volinfo_t *volinfo);
@@ -506,8 +490,6 @@ glusterd_volume_status_copy_to_op_ctx_dict(dict_t *aggr, dict_t *rsp_dict);
int
glusterd_volume_rebalance_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict);
int
-glusterd_volume_tier_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict);
-int
glusterd_volume_heal_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict);
int
glusterd_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict);
@@ -616,12 +598,6 @@ gf_boolean_t
gd_should_i_start_rebalance(glusterd_volinfo_t *volinfo);
int
-glusterd_is_tierd_enabled(glusterd_volinfo_t *volinfo);
-
-int
-glusterd_is_tierd_supposed_to_be_enabled(glusterd_volinfo_t *volinfo);
-
-int
glusterd_is_volume_quota_enabled(glusterd_volinfo_t *volinfo);
int
@@ -789,21 +765,10 @@ int
glusterd_volume_get_rebalance_status_str(glusterd_volinfo_t *volinfo,
char *rebal_status_str);
-int
-glusterd_volume_get_hot_tier_type_str(glusterd_volinfo_t *volinfo,
- char **hot_tier_type_str);
-
-int
-glusterd_volume_get_cold_tier_type_str(glusterd_volinfo_t *volinfo,
- char **cold_tier_type_str);
-
void
glusterd_list_add_order(struct cds_list_head *new, struct cds_list_head *head,
int (*compare)(struct cds_list_head *,
struct cds_list_head *));
-int
-glusterd_disallow_op_for_tier(glusterd_volinfo_t *volinfo, glusterd_op_t op,
- int cmd);
struct rpc_clnt *
glusterd_defrag_rpc_get(glusterd_defrag_info_t *defrag);
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index c8b6875f7db..794b1887847 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -3209,8 +3209,7 @@ volgen_graph_build_clients(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
goto out;
}
- if ((volinfo->type != GF_CLUSTER_TYPE_TIER) &&
- (volinfo->dist_leaf_count < volinfo->brick_count) &&
+ if ((volinfo->dist_leaf_count < volinfo->brick_count) &&
((volinfo->brick_count % volinfo->dist_leaf_count) != 0)) {
gf_msg("glusterd", GF_LOG_ERROR, 0, GD_MSG_VOLUME_INCONSISTENCY,
"volume inconsistency: "
@@ -3255,50 +3254,6 @@ out:
}
static int
-volgen_graph_build_clients_for_tier_shd(volgen_graph_t *graph,
- glusterd_volinfo_t *volinfo,
- dict_t *set_dict)
-{
- int ret = 0;
- glusterd_volinfo_t *dup_volinfo = NULL;
- gf_boolean_t is_hot_tier = _gf_false;
- gf_boolean_t is_hot_shd = _gf_false;
- gf_boolean_t is_cold_shd = _gf_false;
-
- is_cold_shd = glusterd_is_shd_compatible_type(volinfo->tier_info.cold_type);
- is_hot_shd = glusterd_is_shd_compatible_type(volinfo->tier_info.hot_type);
-
- if (is_cold_shd && is_hot_shd) {
- ret = volgen_graph_build_clients(graph, volinfo, set_dict, NULL);
- return ret;
- }
-
- if (is_cold_shd) {
- ret = glusterd_create_sub_tier_volinfo(volinfo, &dup_volinfo,
- is_hot_tier, volinfo->volname);
- if (ret)
- goto out;
- ret = volgen_graph_build_clients(graph, dup_volinfo, set_dict, NULL);
- if (ret)
- goto out;
- }
- if (is_hot_shd) {
- is_hot_tier = _gf_true;
- ret = glusterd_create_sub_tier_volinfo(volinfo, &dup_volinfo,
- is_hot_tier, volinfo->volname);
- if (ret)
- goto out;
- ret = volgen_graph_build_clients(graph, dup_volinfo, set_dict, NULL);
- if (ret)
- goto out;
- }
-out:
- if (dup_volinfo)
- glusterd_volinfo_delete(dup_volinfo);
- return ret;
-}
-
-static int
volgen_link_bricks(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
char *xl_type, char *xl_namefmt, size_t child_count,
size_t sub_count, size_t start_count, xlator_t *trav)
@@ -3359,22 +3314,6 @@ volgen_link_bricks_from_list_tail_start(volgen_graph_t *graph,
}
static int
-volgen_link_bricks_from_list_head_start(volgen_graph_t *graph,
- glusterd_volinfo_t *volinfo,
- char *xl_type, char *xl_namefmt,
- size_t child_count, size_t sub_count,
- size_t start_count)
-{
- xlator_t *trav = NULL;
-
- for (trav = first_of(graph); trav->next; trav = trav->next)
- ;
-
- return volgen_link_bricks(graph, volinfo, xl_type, xl_namefmt, child_count,
- sub_count, start_count, trav);
-}
-
-static int
volgen_link_bricks_from_list_tail(volgen_graph_t *graph,
glusterd_volinfo_t *volinfo, char *xl_type,
char *xl_namefmt, size_t child_count,
@@ -3393,21 +3332,6 @@ volgen_link_bricks_from_list_tail(volgen_graph_t *graph,
sub_count, 0, trav);
}
-static int
-volgen_link_bricks_from_list_head(volgen_graph_t *graph,
- glusterd_volinfo_t *volinfo, char *xl_type,
- char *xl_namefmt, size_t child_count,
- size_t sub_count)
-{
- xlator_t *trav = NULL;
-
- for (trav = first_of(graph); trav->next; trav = trav->next)
- ;
-
- return volgen_link_bricks(graph, volinfo, xl_type, xl_namefmt, child_count,
- sub_count, 0, trav);
-}
-
/**
* This is the build graph function for user-serviceable snapshots.
* Generates snapview-client
@@ -3632,11 +3556,6 @@ volgen_graph_build_dht_cluster(volgen_graph_t *graph,
if (clusters < 0)
goto out;
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- ret = 0;
- goto out;
- }
-
dht = first_of(graph);
ret = _graph_get_decommissioned_children(dht, volinfo,
&decommissioned_children);
@@ -3666,11 +3585,6 @@ volgen_graph_build_ec_clusters(volgen_graph_t *graph,
char option[32] = {0};
int start_count = 0;
- if (volinfo->tier_info.cur_tier_hot &&
- volinfo->tier_info.cold_type == GF_CLUSTER_TYPE_DISPERSE)
- start_count = volinfo->tier_info.cold_brick_count /
- volinfo->tier_info.cold_disperse_count;
-
clusters = volgen_link_bricks_from_list_tail_start(
graph, volinfo, disperse_args[0], disperse_args[1],
volinfo->brick_count, volinfo->disperse_count, start_count);
@@ -3776,7 +3690,6 @@ volgen_graph_build_afr_clusters(volgen_graph_t *graph,
char *replicate_name = "%s-replicate-%d";
xlator_t *afr = NULL;
char option[32] = {0};
- int start_count = 0;
if (glusterd_volinfo_get_boolean(volinfo, "cluster.jbr") > 0) {
replicate_type = "experimental/jbrc";
@@ -3784,18 +3697,9 @@ volgen_graph_build_afr_clusters(volgen_graph_t *graph,
replicate_type = "cluster/replicate";
}
- if (volinfo->tier_info.cold_type == GF_CLUSTER_TYPE_REPLICATE)
- start_count = volinfo->tier_info.cold_brick_count /
- volinfo->tier_info.cold_replica_count;
-
- if (volinfo->tier_info.cur_tier_hot)
- clusters = volgen_link_bricks_from_list_head_start(
- graph, volinfo, replicate_type, replicate_name,
- volinfo->brick_count, volinfo->replica_count, start_count);
- else
- clusters = volgen_link_bricks_from_list_tail(
- graph, volinfo, replicate_type, replicate_name,
- volinfo->brick_count, volinfo->replica_count);
+ clusters = volgen_link_bricks_from_list_tail(
+ graph, volinfo, replicate_type, replicate_name, volinfo->brick_count,
+ volinfo->replica_count);
if (clusters < 0)
goto out;
@@ -3827,13 +3731,9 @@ volume_volgen_graph_build_clusters(volgen_graph_t *graph,
glusterd_volinfo_t *volinfo,
gf_boolean_t is_quotad)
{
- char *tier_args[] = {"cluster/tier", "%s-tier-%d"};
int clusters = 0;
int dist_count = 0;
int ret = -1;
- char tmp_volname[GD_VOLUME_NAME_MAX_TIER] = {
- 0,
- };
if (!volinfo->dist_leaf_count)
goto out;
@@ -3848,11 +3748,6 @@ volume_volgen_graph_build_clusters(volgen_graph_t *graph,
if (clusters < 0)
goto out;
break;
- case GF_CLUSTER_TYPE_TIER:
- ret = volgen_link_bricks_from_list_head(
- graph, volinfo, tier_args[0], tier_args[1],
- volinfo->brick_count, volinfo->replica_count);
- break;
case GF_CLUSTER_TYPE_DISPERSE:
clusters = volgen_graph_build_ec_clusters(graph, volinfo);
if (clusters < 0)
@@ -3872,24 +3767,11 @@ build_distribute:
ret = -1;
goto out;
}
- if (volinfo->tier_info.hot_brick_count) {
- if (snprintf(tmp_volname, GD_VOLUME_NAME_MAX_TIER, "%s",
- volinfo->volname) >= GD_VOLUME_NAME_MAX_TIER) {
- ret = -1;
- goto out;
- }
- if (volinfo->tier_info.cur_tier_hot)
- strcat(volinfo->volname, "-hot");
- else
- strcat(volinfo->volname, "-cold");
- }
clusters = volgen_graph_build_readdir_ahead(graph, volinfo, dist_count);
if (clusters < 0)
goto out;
ret = volgen_graph_build_dht_cluster(graph, volinfo, dist_count, is_quotad);
- if (volinfo->tier_info.hot_brick_count)
- strcpy(volinfo->volname, tmp_volname);
if (ret)
goto out;
@@ -4105,137 +3987,6 @@ graph_set_generic_options(xlator_t *this, volgen_graph_t *graph,
}
static int
-volume_volgen_graph_build_clusters_tier(volgen_graph_t *graph,
- glusterd_volinfo_t *volinfo,
- gf_boolean_t is_quotad)
-{
- int ret = -1;
- xlator_t *xl, *hxl, *cxl;
- char *rule = NULL;
- int st_brick_count = 0;
- int st_replica_count = 0;
- int st_disperse_count = 0;
- int st_dist_leaf_count = 0;
- int st_type = 0;
- int dist_count = 0;
- int start_count = 0;
- char *decommissioned_children = NULL;
- glusterd_volinfo_t *dup_volinfo = NULL;
- gf_boolean_t is_hot_tier = _gf_false;
-
- st_brick_count = volinfo->brick_count;
- st_replica_count = volinfo->replica_count;
- st_disperse_count = volinfo->disperse_count;
- st_type = volinfo->type;
- st_dist_leaf_count = volinfo->dist_leaf_count;
-
- volinfo->dist_leaf_count = volinfo->tier_info.cold_dist_leaf_count;
- volinfo->brick_count = volinfo->tier_info.cold_brick_count;
- volinfo->replica_count = volinfo->tier_info.cold_replica_count;
- volinfo->disperse_count = volinfo->tier_info.cold_disperse_count;
- volinfo->redundancy_count = volinfo->tier_info.cold_redundancy_count;
- volinfo->type = volinfo->tier_info.cold_type;
- volinfo->tier_info.cur_tier_hot = 0;
- ret = glusterd_create_sub_tier_volinfo(volinfo, &dup_volinfo, is_hot_tier,
- volinfo->volname);
- if (ret)
- goto out;
-
- ret = volume_volgen_graph_build_clusters(graph, dup_volinfo, is_quotad);
- if (ret)
- goto out;
- cxl = first_of(graph);
-
- volinfo->type = volinfo->tier_info.hot_type;
- volinfo->brick_count = volinfo->tier_info.hot_brick_count;
- volinfo->replica_count = volinfo->tier_info.hot_replica_count;
- volinfo->dist_leaf_count = glusterd_get_dist_leaf_count(volinfo);
- volinfo->disperse_count = 0;
- volinfo->tier_info.cur_tier_hot = 1;
-
- dist_count = volinfo->brick_count / volinfo->dist_leaf_count;
-
- if (volinfo->tier_info.cold_type == GF_CLUSTER_TYPE_REPLICATE) {
- start_count = volinfo->tier_info.cold_brick_count /
- volinfo->tier_info.cold_replica_count;
- }
-
- if (volinfo->dist_leaf_count != 1) {
- ret = volgen_link_bricks_from_list_head_start(
- graph, volinfo, "cluster/replicate", "%s-replicate-%d",
- volinfo->brick_count, volinfo->replica_count, start_count);
- if (ret != -1) {
- ret = set_afr_pending_xattrs_option(graph, volinfo, ret);
- if (ret)
- goto out;
- volgen_link_bricks_from_list_tail(
- graph, volinfo, "cluster/distribute", "%s-hot-dht", dist_count,
- dist_count);
- }
- } else {
- ret = volgen_link_bricks_from_list_head(
- graph, volinfo, "cluster/distribute", "%s-hot-dht", dist_count,
- dist_count);
- }
- if (ret == -1)
- goto out;
-
- hxl = first_of(graph);
-
- volinfo->type = GF_CLUSTER_TYPE_TIER;
- if (!is_quotad) {
- xl = volgen_graph_add_nolink(graph, "cluster/tier", "%s-%s",
- volinfo->volname, "tier-dht");
- } else {
- xl = volgen_graph_add_nolink(graph, "cluster/tier", "%s",
- volinfo->volname);
- }
- if (!xl)
- goto out;
-
- gf_asprintf(&rule, "%s-hot-dht", volinfo->volname);
-
- ret = xlator_set_fixed_option(xl, "rule", rule);
- if (ret)
- goto out;
-
- /*Each dht/tier layer must have a different xattr name*/
- ret = xlator_set_fixed_option(xl, "xattr-name", "trusted.tier.tier-dht");
- if (ret)
- goto out;
-
- ret = volgen_xlator_link(xl, cxl);
- ret = volgen_xlator_link(xl, hxl);
-
- st_type = GF_CLUSTER_TYPE_TIER;
-
- ret = _graph_get_decommissioned_children(xl, volinfo,
- &decommissioned_children);
- if (ret)
- goto out;
- if (decommissioned_children) {
- ret = xlator_set_fixed_option(xl, "decommissioned-bricks",
- decommissioned_children);
- if (ret)
- goto out;
- }
-
-out:
- volinfo->brick_count = st_brick_count;
- volinfo->replica_count = st_replica_count;
- volinfo->disperse_count = st_disperse_count;
- volinfo->type = st_type;
- volinfo->dist_leaf_count = st_dist_leaf_count;
- volinfo->tier_info.cur_tier_hot = 0;
-
- if (dup_volinfo)
- glusterd_volinfo_delete(dup_volinfo);
- GF_FREE(rule);
- GF_FREE(decommissioned_children);
- return ret;
-}
-
-static int
client_graph_builder(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
dict_t *set_dict, void *param)
{
@@ -4266,9 +4017,6 @@ client_graph_builder(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
if (ret)
goto out;
- if (volinfo->type == GF_CLUSTER_TYPE_TIER)
- ret = volume_volgen_graph_build_clusters_tier(graph, volinfo,
- _gf_false);
else
ret = volume_volgen_graph_build_clusters(graph, volinfo, _gf_false);
@@ -4839,37 +4587,14 @@ volgen_graph_set_iam_shd(volgen_graph_t *graph)
}
static int
-glusterd_prepare_shd_volume_options_for_tier(glusterd_volinfo_t *volinfo,
- dict_t *set_dict)
-{
- int ret = -1;
-
- ret = volgen_set_shd_key_enable(set_dict, volinfo->tier_info.cold_type);
- if (ret)
- goto out;
-
- ret = volgen_set_shd_key_enable(set_dict, volinfo->tier_info.hot_type);
- if (ret)
- goto out;
-out:
- return ret;
-}
-
-static int
prepare_shd_volume_options(glusterd_volinfo_t *volinfo, dict_t *mod_dict,
dict_t *set_dict)
{
int ret = 0;
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- ret = glusterd_prepare_shd_volume_options_for_tier(volinfo, set_dict);
- if (ret)
- goto out;
- } else {
- ret = volgen_set_shd_key_enable(set_dict, volinfo->type);
- if (ret)
- goto out;
- }
+ ret = volgen_set_shd_key_enable(set_dict, volinfo->type);
+ if (ret)
+ goto out;
ret = dict_set_uint32(set_dict, "trusted-client", GF_CLIENT_TRUSTED);
if (ret)
@@ -4899,70 +4624,17 @@ build_afr_ec_clusters(volgen_graph_t *graph, glusterd_volinfo_t *volinfo)
}
static int
-build_afr_ec_clusters_for_tier(volgen_graph_t *graph,
- glusterd_volinfo_t *volinfo, dict_t *set_dict)
-{
- int ret = 0;
- glusterd_volinfo_t *dup_volinfo[2] = {NULL, NULL};
- int clusters = 0;
- int i = 0;
- gf_boolean_t is_hot_tier = _gf_false;
-
- if (glusterd_is_shd_compatible_type(volinfo->tier_info.cold_type)) {
- ret = glusterd_create_sub_tier_volinfo(volinfo, &dup_volinfo[0],
- is_hot_tier, volinfo->volname);
- if (ret)
- goto out;
- }
- if (glusterd_is_shd_compatible_type(volinfo->tier_info.hot_type)) {
- is_hot_tier = _gf_true;
- ret = glusterd_create_sub_tier_volinfo(volinfo, &dup_volinfo[1],
- is_hot_tier, volinfo->volname);
- if (ret)
- goto out;
- dup_volinfo[1]->tier_info.cur_tier_hot = 1;
- }
-
- for (i = 0; i < 2; i++) {
- if (!dup_volinfo[i])
- continue;
- ret = build_afr_ec_clusters(graph, dup_volinfo[i]);
- if (ret < 0)
- goto out;
- clusters += ret;
- }
- ret = 0;
-out:
- for (i = 0; i < 2; i++) {
- if (dup_volinfo[i])
- glusterd_volinfo_delete(dup_volinfo[i]);
- }
-
- if (ret)
- clusters = -1;
-
- return clusters;
-}
-
-static int
build_shd_clusters(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
dict_t *set_dict)
{
int ret = 0;
int clusters = -1;
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- ret = volgen_graph_build_clients_for_tier_shd(graph, volinfo, set_dict);
- if (ret)
- goto out;
+ ret = volgen_graph_build_clients(graph, volinfo, set_dict, NULL);
+ if (ret)
+ goto out;
+ clusters = build_afr_ec_clusters(graph, volinfo);
- clusters = build_afr_ec_clusters_for_tier(graph, volinfo, set_dict);
- } else {
- ret = volgen_graph_build_clients(graph, volinfo, set_dict, NULL);
- if (ret)
- goto out;
- clusters = build_afr_ec_clusters(graph, volinfo);
- }
out:
return clusters;
}
@@ -4981,16 +4653,6 @@ gd_is_self_heal_enabled(glusterd_volinfo_t *volinfo, dict_t *dict)
shd_key = volgen_get_shd_key(volinfo->type);
shd_enabled = dict_get_str_boolean(dict, shd_key, _gf_true);
break;
- case GF_CLUSTER_TYPE_TIER:
- shd_key = volgen_get_shd_key(volinfo->tier_info.cold_type);
- if (shd_key)
- shd_enabled = dict_get_str_boolean(dict, shd_key, _gf_true);
-
- shd_key = volgen_get_shd_key(volinfo->tier_info.hot_type);
- if (shd_key)
- shd_enabled |= dict_get_str_boolean(dict, shd_key, _gf_true);
-
- break;
default:
break;
}
@@ -5041,12 +4703,7 @@ build_rebalance_volfile(glusterd_volinfo_t *volinfo, char *filepath,
if (ret)
goto out;
- if (volinfo->type == GF_CLUSTER_TYPE_TIER)
- ret = volume_volgen_graph_build_clusters_tier(&graph, volinfo,
- _gf_false);
- else
- ret = volume_volgen_graph_build_clusters(&graph, volinfo, _gf_false);
-
+ ret = volume_volgen_graph_build_clusters(&graph, volinfo, _gf_false);
if (ret)
goto out;
@@ -5547,12 +5204,7 @@ build_quotad_graph(volgen_graph_t *graph, dict_t *mod_dict)
if (ret)
goto out;
- if (voliter->type == GF_CLUSTER_TYPE_TIER)
- ret = volume_volgen_graph_build_clusters_tier(&cgraph, voliter,
- _gf_true);
- else
- ret = volume_volgen_graph_build_clusters(&cgraph, voliter,
- _gf_true);
+ ret = volume_volgen_graph_build_clusters(&cgraph, voliter, _gf_true);
if (ret) {
ret = -1;
goto out;
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
index fa3d620a4b0..991063ee487 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
@@ -779,51 +779,6 @@ glusterd_handle_cli_delete_volume(rpcsvc_request_t *req)
return glusterd_big_locked_handler(req,
__glusterd_handle_cli_delete_volume);
}
-int
-glusterd_handle_shd_option_for_tier(glusterd_volinfo_t *volinfo, char *value,
- dict_t *dict)
-{
- int count = 0;
- char dict_key[64] = {
- 0,
- };
- int keylen;
- char *key = NULL;
- int ret = 0;
-
- key = gd_get_shd_key(volinfo->tier_info.cold_type);
- if (key) {
- count++;
- keylen = snprintf(dict_key, sizeof(dict_key), "key%d", count);
- ret = dict_set_strn(dict, dict_key, keylen, key);
- if (ret)
- goto out;
- keylen = snprintf(dict_key, sizeof(dict_key), "value%d", count);
- ret = dict_set_strn(dict, dict_key, keylen, value);
- if (ret)
- goto out;
- }
-
- key = gd_get_shd_key(volinfo->tier_info.hot_type);
- if (key) {
- count++;
- keylen = snprintf(dict_key, sizeof(dict_key), "key%d", count);
- ret = dict_set_strn(dict, dict_key, keylen, key);
- if (ret)
- goto out;
- keylen = snprintf(dict_key, sizeof(dict_key), "value%d", count);
- ret = dict_set_strn(dict, dict_key, keylen, value);
- if (ret)
- goto out;
- }
-
- ret = dict_set_int32n(dict, "count", SLEN("count"), count);
- if (ret)
- goto out;
-
-out:
- return ret;
-}
static int
glusterd_handle_heal_options_enable_disable(rpcsvc_request_t *req, dict_t *dict,
glusterd_volinfo_t *volinfo)
@@ -863,23 +818,6 @@ glusterd_handle_heal_options_enable_disable(rpcsvc_request_t *req, dict_t *dict,
value = "disable";
}
- /* Convert this command to volume-set command based on volume type */
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- switch (heal_op) {
- case GF_SHD_OP_HEAL_ENABLE:
- case GF_SHD_OP_HEAL_DISABLE:
- ret = glusterd_handle_shd_option_for_tier(volinfo, value, dict);
- if (!ret)
- goto set_volume;
- goto out;
- /* For any other heal_op, including granular-entry heal,
- * just break out of the block but don't goto out yet.
- */
- default:
- break;
- }
- }
-
if ((heal_op == GF_SHD_OP_HEAL_ENABLE) ||
(heal_op == GF_SHD_OP_HEAL_DISABLE)) {
key = volgen_get_shd_key(volinfo->type);
@@ -906,7 +844,6 @@ glusterd_handle_heal_options_enable_disable(rpcsvc_request_t *req, dict_t *dict,
if (ret)
goto out;
-set_volume:
ret = glusterd_op_begin_synctask(req, GD_OP_SET_VOLUME, dict);
out:
@@ -2566,25 +2503,6 @@ glusterd_op_start_volume(dict_t *dict, char **op_errstr)
if (ret)
goto out;
}
- if (conf->op_version <= GD_OP_VERSION_3_7_6) {
- /*
- * Starting tier daemon on originator node will fail if
- * at least one of the peer host brick for the volume.
- * Because The bricks in the peer haven't started when you
- * commit on originator node.
- * Please upgrade to version greater than GD_OP_VERSION_3_7_6
- */
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- if (volinfo->rebal.op != GD_OP_REMOVE_BRICK) {
- glusterd_defrag_info_set(volinfo, dict,
- GF_DEFRAG_CMD_START_TIER,
- GF_DEFRAG_CMD_START, GD_OP_REBALANCE);
- }
- glusterd_restart_rebalance_for_volume(volinfo);
- }
- } else {
- /* Starting tier daemon is moved into post validate phase */
- }
svc = &(volinfo->gfproxyd.svc);
ret = svc->manager(svc, volinfo, PROC_START_NO_WAIT);
@@ -2623,16 +2541,6 @@ glusterd_stop_volume(glusterd_volinfo_t *volinfo)
}
}
- /* call tier manager before the voluem status is set as stopped
- * as tier uses that as a check in the manager
- * */
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- svc = &(volinfo->tierd.svc);
- ret = svc->manager(svc, volinfo, PROC_START_NO_WAIT);
- if (ret)
- goto out;
- }
-
glusterd_set_volume_status(volinfo, GLUSTERD_STATUS_STOPPED);
ret = glusterd_store_volinfo(volinfo, GLUSTERD_VOLINFO_VER_AC_INCREMENT);
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index 63e02d45624..73cea5d5478 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -474,18 +474,6 @@ validate_disperse_heal_enable_disable(glusterd_volinfo_t *volinfo, dict_t *dict,
char *key, char *value, char **op_errstr)
{
int ret = 0;
- if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
- if (volinfo->tier_info.cold_type != GF_CLUSTER_TYPE_DISPERSE &&
- volinfo->tier_info.hot_type != GF_CLUSTER_TYPE_DISPERSE) {
- gf_asprintf(op_errstr,
- "Volume %s is not containing "
- "disperse type",
- volinfo->volname);
-
- return -1;
- } else
- return 0;
- }
if (volinfo->type != GF_CLUSTER_TYPE_DISPERSE) {
gf_asprintf(op_errstr, "Volume %s is not of disperse type",
@@ -508,8 +496,7 @@ validate_lock_migration_option(glusterd_volinfo_t *volinfo, dict_t *dict,
this = THIS;
GF_ASSERT(this);
- if (volinfo->replica_count > 1 || volinfo->disperse_count ||
- volinfo->type == GF_CLUSTER_TYPE_TIER) {
+ if (volinfo->replica_count > 1 || volinfo->disperse_count) {
snprintf(errstr, sizeof(errstr),
"Lock migration is "
"a experimental feature. Currently works with"
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index ca8e82afb47..305a17bb447 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -27,7 +27,6 @@
#include "rpcsvc.h"
#include "glusterd-sm.h"
#include "glusterd-snapd-svc.h"
-#include "glusterd-tierd-svc.h"
#include "glusterd-shd-svc.h"
#include "glusterd-bitd-svc.h"
#include "glusterd1-xdr.h"
@@ -402,28 +401,11 @@ typedef enum gd_quorum_status_ {
DOESNT_MEET_QUORUM, // Follows quorum and does not meet.
} gd_quorum_status_t;
-typedef struct tier_info_ {
- int cold_type;
- int cold_brick_count;
- int cold_replica_count;
- int cold_disperse_count;
- int cold_dist_leaf_count;
- int cold_redundancy_count;
- int hot_type;
- int hot_brick_count;
- int hot_replica_count;
- int promoted;
- int demoted;
- uint16_t cur_tier_hot;
-} gd_tier_info_t;
-
struct glusterd_volinfo_ {
gf_lock_t lock;
gf_boolean_t is_snap_volume;
glusterd_snap_t *snapshot;
uuid_t restored_from_snap;
- gd_tier_info_t tier_info;
- gf_boolean_t is_tier_enabled;
char parent_volname[GD_VOLUME_NAME_MAX];
/* In case of a snap volume
i.e (is_snap_volume == TRUE) this
@@ -483,8 +465,6 @@ struct glusterd_volinfo_ {
/* Bitrot scrub status*/
glusterd_bitrot_scrub_t bitrot_scrub;
- glusterd_rebalance_t tier;
-
int version;
uint32_t quota_conf_version;
uint32_t cksum;
@@ -513,7 +493,6 @@ struct glusterd_volinfo_ {
gd_quorum_status_t quorum_status;
glusterd_snapdsvc_t snapd;
- glusterd_tierdsvc_t tierd;
glusterd_shdsvc_t shd;
glusterd_gfproxydsvc_t gfproxyd;
int32_t quota_xattr_version;
@@ -674,28 +653,6 @@ typedef ssize_t (*gd_serialize_t)(struct iovec outmsg, void *args);
} \
} while (0)
-#define GLUSTERD_GET_TIER_DIR(path, volinfo, priv) \
- do { \
- int32_t _tier_dir_len; \
- _tier_dir_len = snprintf(path, PATH_MAX, "%s/tier/%s", priv->workdir, \
- volinfo->volname); \
- if ((_tier_dir_len < 0) || (_tier_dir_len >= PATH_MAX)) { \
- path[0] = 0; \
- } \
- } while (0)
-
-#define GLUSTERD_GET_TIER_PID_FILE(path, volinfo, priv) \
- do { \
- char tier_path[PATH_MAX]; \
- int32_t _tier_pid_len; \
- GLUSTERD_GET_TIER_DIR(tier_path, volinfo, priv); \
- _tier_pid_len = snprintf(path, PATH_MAX, "%s/run/%s-tierd.pid", \
- tier_path, volinfo->volname); \
- if ((_tier_pid_len < 0) || (_tier_pid_len >= PATH_MAX)) { \
- path[0] = 0; \
- } \
- } while (0)
-
#define GLUSTERD_GET_SHD_RUNDIR(path, volinfo, priv) \
do { \
int32_t _shd_dir_len; \
@@ -882,10 +839,7 @@ typedef ssize_t (*gd_serialize_t)(struct iovec outmsg, void *args);
#define GLUSTERD_GET_DEFRAG_PROCESS(path, volinfo) \
do { \
- if (volinfo->rebal.defrag_cmd == GF_DEFRAG_CMD_START_TIER) \
- snprintf(path, NAME_MAX, "tier"); \
- else \
- snprintf(path, NAME_MAX, "rebalance"); \
+ snprintf(path, NAME_MAX, "rebalance"); \
} while (0)
#define GLUSTERD_GET_DEFRAG_DIR(path, volinfo, priv) \
@@ -1261,10 +1215,6 @@ int
glusterd_fetchsnap_notify(xlator_t *this);
int
-glusterd_add_tier_volume_detail_to_dict(glusterd_volinfo_t *volinfo,
- dict_t *volumes, int count);
-
-int
glusterd_add_volume_detail_to_dict(glusterd_volinfo_t *volinfo, dict_t *volumes,
int count);
@@ -1400,8 +1350,6 @@ manage_export_config(char *volname, char *value, char **op_errstr);
int
glusterd_op_add_brick(dict_t *dict, char **op_errstr);
int
-glusterd_op_add_tier_brick(dict_t *dict, char **op_errstr);
-int
glusterd_op_remove_brick(dict_t *dict, char **op_errstr);
int
glusterd_op_stage_add_brick(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
@@ -1543,19 +1491,8 @@ glusterd_should_i_stop_bitd();
int
glusterd_remove_brick_migrate_cbk(glusterd_volinfo_t *volinfo,
gf_defrag_status_t status);
-/* tier */
-
int
__glusterd_handle_reset_brick(rpcsvc_request_t *req);
-int
-glusterd_op_stage_tier(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
-int
-glusterd_op_tier_start_stop(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
-int
-glusterd_op_remove_tier_brick(dict_t *dict, char **op_errstr, dict_t *rsp_dict);
-int
-glusterd_tier_prevalidate(dict_t *dict, char **op_errstr, dict_t *rsp_dict,
- uint32_t *op_errno);
int
glusterd_options_init(xlator_t *this);