diff options
author | Ravishankar N <ravishankar@redhat.com> | 2016-05-18 11:21:39 +0000 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2016-05-18 21:25:32 -0700 |
commit | 4af3ddd26b53ea2f2d7923ba097946deee46f527 (patch) | |
tree | 335b7d862e9c20b9127fb26e0c30d68a9bbb4d81 /xlators/mgmt | |
parent | 77591f4ddc1bfb5dd846314aff5dbee37ca590d2 (diff) |
Revert glusterd/afr: store afr pending xattrs as a volume option
This patch reverts changes introduced by commit
6e635284a4411b816d4d860a28262c9e6dc4bd6a in the release-3.8 branch. The
commit itself was inherited from http://review.gluster.org/#/c/12738/ in
master when the branch was created.
Reverting it for the same reason it was reverted in 3.7 branch as well:
It breaks the rolling upgrade scenario and these changes will be
required only when server side AFR materializes, possibly for gluster
4.0.
Change-Id: Ib3bb78994d7375f7c34df9897dfaf653ea909924
BUG: 1337130
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/14414
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 104 |
1 files changed, 7 insertions, 97 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index e88116e02ba..31382b2dbfa 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -3468,80 +3468,6 @@ out: } static int -set_afr_pending_xattrs_option (volgen_graph_t *graph, - glusterd_volinfo_t *volinfo, - int clusters) -{ - xlator_t *xlator = NULL; - xlator_t **afr_xlators_list = NULL; - xlator_t *this = NULL; - glusterd_conf_t *conf = NULL; - glusterd_brickinfo_t *brick = NULL; - char *ptr = NULL; - int i = 0; - int index = -1; - int ret = 0; - char *afr_xattrs_list = NULL; - int list_size = -1; - - 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_7) - return ret; - - /* (brick_id x rep.count) + (rep.count-1 commas) + NULL*/ - list_size = (1024 * volinfo->replica_count) + - (volinfo->replica_count - 1) + 1; - afr_xattrs_list = GF_CALLOC (1, list_size, gf_common_mt_char); - if (!afr_xattrs_list) - goto out; - - ptr = afr_xattrs_list; - afr_xlators_list = GF_CALLOC (clusters, sizeof (xlator_t *), - gf_common_mt_xlator_t); - if (!afr_xlators_list) - goto out; - - xlator = first_of (graph); - - for (i = 0, index = clusters - 1; i < clusters; i++) { - afr_xlators_list[index--] = xlator; - xlator = xlator->next; - } - - i = 1; - index = 0; - - cds_list_for_each_entry (brick, &volinfo->bricks, brick_list) { - if (index == clusters) - break; - strncat (ptr, brick->brick_id, strlen(brick->brick_id)); - if (i == volinfo->replica_count) { - ret = xlator_set_option (afr_xlators_list[index++], - "afr-pending-xattr", - afr_xattrs_list); - if (ret) - return ret; - memset (afr_xattrs_list, 0, list_size); - ptr = afr_xattrs_list; - i = 1; - continue; - } - ptr[strlen(brick->brick_id)] = ','; - ptr += strlen (brick->brick_id) + 1; - i++; - } - -out: - GF_FREE (afr_xattrs_list); - GF_FREE (afr_xlators_list); - return ret; -} - -static int volgen_graph_build_afr_clusters (volgen_graph_t *graph, glusterd_volinfo_t *volinfo) { @@ -3552,7 +3478,7 @@ 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; + int start_count = 0; if (glusterd_volinfo_get_boolean(volinfo, "cluster.jbr") > 0) { replicate_type = "experimental/jbrc"; @@ -3583,11 +3509,6 @@ volgen_graph_build_afr_clusters (volgen_graph_t *graph, if (clusters < 0) goto out; - ret = set_afr_pending_xattrs_option (graph, volinfo, clusters); - if (ret) { - clusters = -1; - goto out; - } if (!volinfo->arbiter_count) goto out; @@ -3610,6 +3531,8 @@ volume_volgen_graph_build_clusters (volgen_graph_t *graph, glusterd_volinfo_t *volinfo, gf_boolean_t is_quotad) { + char *replicate_args[] = {"cluster/replicate", + "%s-replicate-%d"}; char *tier_args[] = {"cluster/tier", "%s-tier-%d"}; char *stripe_args[] = {"cluster/stripe", @@ -3799,6 +3722,7 @@ volume_volgen_graph_build_clusters_tier (volgen_graph_t *graph, int ret = -1; xlator_t *root = NULL; xlator_t *xl, *hxl, *cxl; + glusterd_brickinfo_t *brick = NULL; char *rule = NULL; int st_brick_count = 0; int st_replica_count = 0; @@ -3808,8 +3732,6 @@ volume_volgen_graph_build_clusters_tier (volgen_graph_t *graph, 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; @@ -3824,13 +3746,8 @@ volume_volgen_graph_build_clusters_tier (volgen_graph_t *graph, 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); + ret = volume_volgen_graph_build_clusters (graph, volinfo, is_quotad); if (ret) goto out; cxl = first_of(graph); @@ -3857,17 +3774,12 @@ volume_volgen_graph_build_clusters_tier (volgen_graph_t *graph, 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, + if (ret != -1) + 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", @@ -3927,8 +3839,6 @@ volume_volgen_graph_build_clusters_tier (volgen_graph_t *graph, 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); return ret; } |