summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorDan Lambright <dlambrig@redhat.com>2015-04-13 02:42:12 +0100
committerVijay Bellur <vbellur@redhat.com>2015-05-09 08:35:14 -0700
commit99b778cbe179104af602b6eedebd31695bec16ae (patch)
tree5352721732f773b117b4a1c771577cedfaf329f4 /xlators/mgmt/glusterd/src/glusterd-utils.c
parent5fd6b3b7e2881d21a1b19fb22366e905314d71bc (diff)
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 <vol> start gluster v detach-tier <vol> commit The status and stop cli commands shall be submitted separately. >Change-Id: I24fda5cc3ba74f5fb8aa9a3234ad51f18b80a8a0 >BUG: 1205540 >Signed-off-by: Dan Lambright <dlambrig@redhat.com> >Signed-off-by: root <root@localhost.localdomain> >Signed-off-by: Dan Lambright <dlambrig@redhat.com> >Reviewed-on: http://review.gluster.org/10108 >Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Change-Id: I212d748d077fb5870ee84b316c653acbafbea3f7 BUG: 1220047 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/10708 Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index f532a9c4714..8209e779c52 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -4426,6 +4426,12 @@ glusterd_restart_gsyncds (glusterd_conf_t *conf)
return ret;
}
+int
+glusterd_calc_dist_leaf_count (int rcount, int scount)
+{
+ return (rcount ? rcount : 1) * (scount ? scount : 1);
+}
+
inline int
glusterd_get_dist_leaf_count (glusterd_volinfo_t *volinfo)
{
@@ -4435,7 +4441,7 @@ glusterd_get_dist_leaf_count (glusterd_volinfo_t *volinfo)
if (volinfo->type == GF_CLUSTER_TYPE_DISPERSE)
return volinfo->disperse_count;
- return (rcount ? rcount : 1) * (scount ? scount : 1);
+ return glusterd_calc_dist_leaf_count (rcount, scount);
}
int
@@ -5149,6 +5155,10 @@ out:
int
glusterd_is_defrag_on (glusterd_volinfo_t *volinfo)
{
+ /* Defrag is never enabled for tiered volumes. */
+ if (volinfo->type == GF_CLUSTER_TYPE_TIER)
+ return 0;
+
return (volinfo->rebal.defrag != NULL);
}