From 99b778cbe179104af602b6eedebd31695bec16ae Mon Sep 17 00:00:00 2001 From: Dan Lambright Date: Mon, 13 Apr 2015 02:42:12 +0100 Subject: glusterd: support for tier volumes 'detach start' and 'detach commit' Back port of http://review.gluster.org/10108 These commands work in a manner analagous to rebalancing when removing a brick. The existing migration daemon detects "detach start" and switches to moving data off the hot tier. While in this state all lookups are directed to the cold tier. gluster v detach-tier start gluster v detach-tier commit The status and stop cli commands shall be submitted separately. >Change-Id: I24fda5cc3ba74f5fb8aa9a3234ad51f18b80a8a0 >BUG: 1205540 >Signed-off-by: Dan Lambright >Signed-off-by: root >Signed-off-by: Dan Lambright >Reviewed-on: http://review.gluster.org/10108 >Reviewed-by: Kaleb KEITHLEY Change-Id: I212d748d077fb5870ee84b316c653acbafbea3f7 BUG: 1220047 Signed-off-by: Mohammed Rafi KC Reviewed-on: http://review.gluster.org/10708 Reviewed-by: Dan Lambright Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 8b37c5ff325..58328b553a4 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -3063,6 +3063,11 @@ 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); @@ -3336,6 +3341,7 @@ volume_volgen_graph_build_clusters_tier (volgen_graph_t *graph, int st_type = 0; char st_volname[GD_VOLUME_NAME_MAX]; int dist_count = 0; + char *decommissioned_children = NULL; st_brick_count = volinfo->brick_count; st_replica_count = volinfo->replica_count; @@ -3413,6 +3419,17 @@ volume_volgen_graph_build_clusters_tier (volgen_graph_t *graph, 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_option (xl, "decommissioned-bricks", + decommissioned_children); + if (ret) + goto out; + } + out: volinfo->brick_count = st_brick_count; volinfo->replica_count = st_replica_count; -- cgit