From 98fa496c211dc0da7bccb68fc57f97d835e56c28 Mon Sep 17 00:00:00 2001 From: Dan Lambright Date: Fri, 18 Sep 2015 00:49:06 -0400 Subject: cluster/tier: add watermarks and policy driver Backport fix 12039 This fix introduces infrastructure to support different policies for promotion and demotion. Currently the tier feature automatically promotes and demotes files periodically based on access. This is good for testing but too stringent for most real workloads. It makes it difficult to fully utilize a hot tier- data will be demoted before it is touched- its unlikely a 100GB hot SSD will have all its data touched in a window of time. A new parameter "mode" allows the user to pick promotion/demotion polcies. The "test mode" will be used for *.t and other general testing. This is the current mechanism. The "cache mode" introduces watermarks. The watermarks represent levels of data residing on the hot tier. "cache mode" policy: The % the hot tier is full is called P. Do not promote or demote more than D MB or F files. A random number [0-100] is called R. Rules for migration: if (P < watermark_low) don't demote, always promote. if (P >= watermark_low) && (P < watermark_hi) demote if R < P; promote if R > P. if (P > watermark_hi) always demote, don't promote. gluster volume set {vol} cluster.watermark-hi % gluster volume set {vol} cluster.watermark-low % gluster volume set {vol} cluster.tier-max-mb {D} gluster volume set {vol} cluster.tier-max-files {F} gluster volume set {vol} cluster.tier-mode {test|cache} > Change-Id: I157f19667ec95aa1d53406041c1e3b073be127c2 > BUG: 1257911 > Signed-off-by: Dan Lambright > Reviewed-on: http://review.gluster.org/12039 > Tested-by: Gluster Build System > Reviewed-by: Atin Mukherjee Signed-off-by: Dan Lambright Signed-off-by: Dan Lambright Conflicts: xlators/cluster/dht/src/dht-rebalance.c xlators/cluster/dht/src/tier.c Change-Id: Ibfe6b89563ceab98708325cf5d5ab0997c64816c BUG: 1270527 Reviewed-on: http://review.gluster.org/12330 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Dan Lambright Tested-by: Dan Lambright --- xlators/cluster/dht/src/dht-common.h | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (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 b1d12c84a9f..26cf27a8676 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -337,6 +337,29 @@ struct dht_container { dict_t *migrate_data; }; +typedef enum tier_mode_ { + TIER_MODE_NONE = 0, + TIER_MODE_TEST, + TIER_MODE_WM +} tier_mode_t; + +typedef struct gf_tier_conf { + int is_tier; + int watermark_hi; + int watermark_low; + int watermark_last; + fsblkcnt_t blocks_total; + fsblkcnt_t blocks_used; + int percent_full; + uint64_t max_migrate_bytes; + int max_migrate_files; + tier_mode_t mode; + int tier_promote_frequency; + int tier_demote_frequency; + uint64_t st_last_promoted_size; + uint64_t st_last_demoted_size; +} gf_tier_conf_t; + struct gf_defrag_info_ { uint64_t total_files; uint64_t total_data; @@ -357,8 +380,7 @@ struct gf_defrag_info_ { gf_boolean_t stats; uint32_t new_commit_hash; gf_defrag_pattern_list_t *defrag_pattern; - int tier_promote_frequency; - int tier_demote_frequency; + gf_tier_conf_t tier_conf; /*Data Tiering params for scanner*/ uint64_t total_files_promoted; @@ -1093,5 +1115,7 @@ int32_t dht_set_local_rebalance (xlator_t *this, dht_local_t *local, struct iatt *stbuf, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); +void +dht_build_root_loc (inode_t *inode, loc_t *loc); #endif/* _DHT_H */ -- cgit