diff options
author | Joseph Fernandes <josferna@redhat.com> | 2016-02-23 12:51:45 +0530 |
---|---|---|
committer | Dan Lambright <dlambrig@redhat.com> | 2016-03-28 09:17:59 -0700 |
commit | b67e569b3906d99677a1349cb82668f9088cf4eb (patch) | |
tree | f1069d4fb553bde90a7241d2effe9e7ef42af164 /xlators/cluster/dht/src/dht-common.h | |
parent | 2d0c2a9e15a581950a966841866f1f18a8888440 (diff) |
tier/dht : Attach tier fix layout to run in background
1. Spawn a thread for background fix-layout for tier process.
2. Once the fix-layout is completed a marker xttr is set on the root of
volume to mark the completion of the background fixlayout, so that
even if the tier process is spawned again, fixlayout will not be
issued, if it was completed last time.
3. Please note that promotion of legacy files will happen eventually as
the ctr lookup heal in the fixlayout slowly heals the ctr db for legacy
files OR the ctr lookup heal happend due to a name lookup.
4. When a detach tier is successful in evacuation data from hot tier, we remove
the marker xattr is removed. So that next attach tier runs the background
tier fixlayout.
what is remaining ?
1. Instead of clearing the marker xattr of tiering fix layout at the end of detach start
clear it during detach commit. But the issue is detach commit is a glusterd operation
and the volume is not mounted in glusterd.
The reason we want to do it in detach commit is that if the admin wants to attach the
same tier again, then a background fixlayout will be triggered, which would not be needed.
2. Clearing the CTR DB of the cold bricks when there is a detach commit, as it will be having
entries which will be stale when the volume is used, with ctr off (ctr is switched off only when
we have detach commit.)
Change-Id: Ibe343572e95865325cd0eef4d0b976b626a3c0c5
BUG: 1313228
Signed-off-by: Joseph Fernandes <josferna@redhat.com>
Reviewed-on: http://review.gluster.org/13491
Smoke: Gluster Build System <jenkins@build.gluster.com>
Tested-by: Joseph Fernandes
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.h')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.h | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index 9238bf09a38..cd192f5baff 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -21,15 +21,16 @@ #ifndef _DHT_H #define _DHT_H -#define GF_XATTR_FIX_LAYOUT_KEY "distribute.fix.layout" -#define GF_XATTR_FILE_MIGRATE_KEY "trusted.distribute.migrate-data" -#define GF_DHT_LOOKUP_UNHASHED_ON 1 -#define GF_DHT_LOOKUP_UNHASHED_AUTO 2 -#define DHT_PATHINFO_HEADER "DISTRIBUTE:" -#define DHT_FILE_MIGRATE_DOMAIN "dht.file.migrate" -#define DHT_LAYOUT_HEAL_DOMAIN "dht.layout.heal" -#define TIERING_MIGRATION_KEY "tiering.migration" -#define DHT_LAYOUT_HASH_INVALID 1 +#define GF_XATTR_FIX_LAYOUT_KEY "distribute.fix.layout" +#define GF_XATTR_TIER_LAYOUT_FIXED_KEY "trusted.tier.fix.layout.complete" +#define GF_XATTR_FILE_MIGRATE_KEY "trusted.distribute.migrate-data" +#define GF_DHT_LOOKUP_UNHASHED_ON 1 +#define GF_DHT_LOOKUP_UNHASHED_AUTO 2 +#define DHT_PATHINFO_HEADER "DISTRIBUTE:" +#define DHT_FILE_MIGRATE_DOMAIN "dht.file.migrate" +#define DHT_LAYOUT_HEAL_DOMAIN "dht.layout.heal" +#define TIERING_MIGRATION_KEY "tiering.migration" +#define DHT_LAYOUT_HASH_INVALID 1 #define DHT_DIR_STAT_BLOCKS 8 #define DHT_DIR_STAT_SIZE 4096 @@ -349,6 +350,13 @@ typedef enum tier_pause_state_ { TIER_PAUSED } tier_pause_state_t; +/* This Structure is only used in tiering fixlayout */ +typedef struct gf_tier_fix_layout_arg { + xlator_t *this; + dict_t *fix_layout; + pthread_t thread_id; +} gf_tier_fix_layout_arg_t; + typedef struct gf_tier_conf { int is_tier; int watermark_hi; @@ -371,6 +379,8 @@ typedef struct gf_tier_conf { pthread_mutex_t pause_mutex; int promote_in_progress; int demote_in_progress; + /* This Structure is only used in tiering fixlayout */ + gf_tier_fix_layout_arg_t tier_fix_layout_arg; } gf_tier_conf_t; struct gf_defrag_info_ { |