summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-snapshot.c
diff options
context:
space:
mode:
authorHari Gowtham <hgowtham@redhat.com>2019-05-02 18:33:34 +0530
committerAmar Tumballi <amarts@redhat.com>2019-05-27 07:50:24 +0000
commite1cc4275583dfd8ae8d0433587f39854c1851794 (patch)
tree5b09910701f803bbc4355f537a698a017513f70c /xlators/mgmt/glusterd/src/glusterd-snapshot.c
parentcce775726af28c602d99f73a65439a2564790381 (diff)
glusterd/tier: remove tier related code from glusterd
The handler functions are pointed to dummy functions. The switch case handling for tier also have been moved to point default case to avoid issues, if reintroduced. The tier changes in DHT still remain as such. updates: bz#1693692 Change-Id: I80d80c9a3eb862b4440a36b31ae82b2e9d92e4dc Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-snapshot.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c140
1 files changed, 0 insertions, 140 deletions
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;
}