diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2015-12-08 19:55:22 +0530 |
---|---|---|
committer | Dan Lambright <dlambrig@redhat.com> | 2015-12-11 04:26:55 -0800 |
commit | 9f35fcf087d5c30d460999d667b1b82dfd08d762 (patch) | |
tree | b205af1cd19af5a51fb0df87e9b858ecc5b9270a /xlators/cluster | |
parent | b21fa41b44097cf54d41aedd914457a2480d43cf (diff) |
tier/dht: files are still going to decommissioned subvol
After detach tier start, creates are still going to hot
tier. Because when creating data files we are not checking for
decommissioned bricks.
Backpor of>
>Change-Id: I8e28258d9b2367dcc8ad6e5e91d0e54d92fdf771
>BUG: 1289602
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
>Reviewed-on: http://review.gluster.org/12914
>Tested-by: Gluster Build System <jenkins@build.gluster.com>
>Reviewed-by: Dan Lambright <dlambrig@redhat.com>
>Tested-by: Dan Lambright <dlambrig@redhat.com>
(cherry picked from commit cb41de7c4a7d620dbab645f2b105286b68bde9a9)
Change-Id: I56e4551657a234ac51fa2513dc46a48c19c4fac7
BUG: 1289602
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/12937
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 6a717678ba4..bc7390b8b40 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -6038,6 +6038,27 @@ err: return 0; } +gf_boolean_t +dht_is_hot_tier_decommissioned (xlator_t *this) +{ + dht_conf_t *conf = NULL; + xlator_t *hot_tier = NULL; + int i = 0; + + conf = this->private; + hot_tier = conf->subvolumes[1]; + + if (conf->decommission_subvols_cnt) { + for (i = 0; i < conf->subvolume_cnt; i++) { + if (conf->decommissioned_bricks[i] && + conf->decommissioned_bricks[i] == hot_tier) + return _gf_true; + } + } + + return _gf_false; +} + int dht_create_tier_wind_to_avail_subvol (call_frame_t *frame, xlator_t *this, xlator_t *subvol, loc_t *loc, int32_t flags, @@ -6058,9 +6079,12 @@ dht_create_tier_wind_to_avail_subvol (call_frame_t *frame, xlator_t *this, if (conf->subvolumes[0] != cold_subvol) { hot_subvol = conf->subvolumes[0]; } - - /* if hot tier full, write to cold */ - if (dht_is_subvol_filled (this, hot_subvol)) { + /* + * if hot tier full, write to cold. + * Also if hot tier is full, create in cold + */ + if (dht_is_subvol_filled (this, hot_subvol) || + dht_is_hot_tier_decommissioned (this)) { gf_msg_debug (this->name, 0, "creating %s on %s", loc->path, cold_subvol->name); |