From 36974c36fa4231df3f0e9428a9da6d1aa33348ab Mon Sep 17 00:00:00 2001 From: Dan Lambright Date: Mon, 5 Oct 2015 19:52:02 +0000 Subject: cluster/tier: add pause tier for snapshots Snaps of tiered volumes cannot handle files undergoing migration. We implement a helper mechanism to "pause" migration. Any files undergoing migration are aborted. Clean up is done to remove sticky bits and data at the destination. Migration is restarted after snap completes. For testing an internal switch is added. It is not exposed externally. gluster volume set vol1 tier-pause [true|false] Change-Id: Ia85bbf89ac142e9b7e73fcbef98bb9da86097799 BUG: 1267950 Signed-off-by: Dan Lambright Reviewed-on: http://review.gluster.org/12304 Reviewed-by: N Balachandran Tested-by: NetBSD Build System Tested-by: Gluster Build System --- xlators/cluster/dht/src/dht-common.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/dht/src/dht-common.h') diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index 95ca7067806..6483b2e86d7 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -293,7 +293,8 @@ enum gf_defrag_type { GF_DEFRAG_CMD_STATUS_TIER = 1 + 6, GF_DEFRAG_CMD_START_DETACH_TIER = 1 + 7, GF_DEFRAG_CMD_STOP_DETACH_TIER = 1 + 8, - + GF_DEFRAG_CMD_PAUSE_TIER = 1 + 9, + GF_DEFRAG_CMD_RESUME_TIER = 1 + 10, }; typedef enum gf_defrag_type gf_defrag_type; @@ -353,6 +354,8 @@ typedef struct gf_tier_conf { int tier_demote_frequency; uint64_t st_last_promoted_size; uint64_t st_last_demoted_size; + int request_pause; + gf_boolean_t paused; } gf_tier_conf_t; struct gf_defrag_info_ { @@ -981,6 +984,12 @@ int dht_newfile_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int gf_defrag_status_get (gf_defrag_info_t *defrag, dict_t *dict); +int +gf_defrag_pause_tier (xlator_t *this, gf_defrag_info_t *defrag); + +int +gf_defrag_resume_tier (xlator_t *this, gf_defrag_info_t *defrag); + int gf_defrag_start_detach_tier (gf_defrag_info_t *defrag); -- cgit