diff options
author | Dan Lambright <dlambrig@redhat.com> | 2015-02-22 11:05:58 -0500 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-03-21 09:50:29 -0700 |
commit | 20355992e8eed7d3ed78a23bc7e922d6ae94860d (patch) | |
tree | c7af71245b57d867ef83edf91dbfe69e622a478d /xlators/cluster/dht/src/dht-common.h | |
parent | 8aa13c8e285ad496ed7c8511ae0b735eed73ebd4 (diff) |
cluster/dht: Add tier translator.
The tier translator shares most of DHT's code. It differs in how
subvolumes are chosen for I/Os, and how file migration (cache promotion
and demotion) is managed. That different functionality is split to either
DHT or tier logic according to the "tier_methods" structure.
A cache promotion and demotion thread is created in a manner
similar to the rebalance daemon. The thread operates a timing
wheel which periodically checks for promotion and demotion candidates
(files). Candidates are queued and then migrated. Candidates must exist on
the same node as the daemon and meet other critera per caching policies.
This patch has two authors (Dan Lambright and Joseph Fernandes). Dan
did the DHT changes and Joe wrote the cache policies. The fix depends on
DHT readidr changes and the database library which have been submitted
separately. Header files in libglusterfs/src/gfdb should be reviewed in
patch 9683.
For more background and design see the feature page [1].
[1]
http://www.gluster.org/community/documentation/index.php/Features/data-classification
Change-Id: Icc26c517ccecf5c42aef039f5b9c6f7afe83e46c
BUG: 1194753
Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-on: http://review.gluster.org/9724
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.h')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index 67e693146af..9145f336d7c 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -267,6 +267,8 @@ enum gf_defrag_type { GF_DEFRAG_CMD_STATUS = 1 + 2, GF_DEFRAG_CMD_START_LAYOUT_FIX = 1 + 3, GF_DEFRAG_CMD_START_FORCE = 1 + 4, + GF_DEFRAG_CMD_START_TIER = 1 + 5, + GF_DEFRAG_CMD_STATUS_TIER = 1 + 6, }; typedef enum gf_defrag_type gf_defrag_type; @@ -310,10 +312,31 @@ struct gf_defrag_info_ { struct timeval start_time; gf_boolean_t stats; gf_defrag_pattern_list_t *defrag_pattern; + int tier_promote_frequency; + int tier_demote_frequency; + + /*Data Tiering params for scanner*/ + uint64_t total_files_promoted; + uint64_t total_files_demoted; + int write_freq_threshold; + int read_freq_threshold; }; typedef struct gf_defrag_info_ gf_defrag_info_t; +struct dht_methods_s { + int32_t (*migration_get_dst_subvol)(xlator_t *this, + dht_local_t *local); + int32_t (*migration_other)(xlator_t *this, + gf_defrag_info_t *defrag); + int32_t (*migration_needed)(xlator_t *this); + xlator_t* (*layout_search)(xlator_t *this, + dht_layout_t *layout, + const char *name); +}; + +typedef struct dht_methods_s dht_methods_t; + struct dht_conf { gf_lock_t subvolume_lock; int subvolume_cnt; @@ -371,6 +394,8 @@ struct dht_conf { gf_boolean_t do_weighting; gf_boolean_t randomize_by_gfid; + dht_methods_t *methods; + struct mem_pool *lock_pool; }; typedef struct dht_conf dht_conf_t; @@ -477,6 +502,10 @@ dht_layout_t *dht_layout_get (xlator_t *this, inode_t dht_layout_t *dht_layout_for_subvol (xlator_t *this, xlator_t *subvol); xlator_t *dht_layout_search (xlator_t *this, dht_layout_t *layout, const char *name); +int32_t +dht_migration_get_dst_subvol(xlator_t *this, dht_local_t *local); +int32_t +dht_migration_needed(xlator_t *this); int dht_layout_normalize (xlator_t *this, loc_t *loc, dht_layout_t *layout); int dht_layout_anomalies (xlator_t *this, loc_t *loc, dht_layout_t *layout, uint32_t *holes_p, uint32_t *overlaps_p, |