diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2015-12-10 20:13:22 +0530 |
---|---|---|
committer | Dan Lambright <dlambrig@redhat.com> | 2016-02-22 06:53:07 -0800 |
commit | 40902503da073bb106ba0eef7788692f0cfcfc20 (patch) | |
tree | 21bf39493246190ca070b177dd65693b6422b305 /xlators/cluster/dht/src/dht-common.c | |
parent | 28f561b1855d118202de3a6d454d688c1ccb9e6e (diff) |
tier:delete the linkfile if data file creation fails
If we are creating data file in a hot subvolume
then we will create a linkfile in cold subvolume.
Linkfile creation happens first. If linkfile creation
was successful and data file creation failed, then
linkfile in cold subvolume will become stale
This patch will delete the linkfile as well, if data
file creation fails
Also this code duplicates dht_create to make tier_create
backport of>
>Change-Id: I377a90dad47f288e9576c7323b23cf694a91a7a3
>BUG: 1290677
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
>Reviewed-on: http://review.gluster.org/12948
>Reviewed-by: N Balachandran <nbalacha@redhat.com>
>Tested-by: NetBSD Build System <jenkins@build.gluster.org>
>Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
>Reviewed-by: Dan Lambright <dlambrig@redhat.com>
>Tested-by: Dan Lambright <dlambrig@redhat.com>
Change-Id: I3689e8ee387fb6731b4b3a7fe8f8190143482eaa
BUG: 1295359
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/13161
Smoke: Gluster Build System <jenkins@build.gluster.com>
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.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index f80924e818b..4e488ee1f8c 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -6049,82 +6049,6 @@ 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, - mode_t mode, mode_t umask, fd_t *fd, - dict_t *params) -{ - xlator_t *hot_subvol = NULL; - xlator_t *cold_subvol = NULL; - dht_conf_t *conf = NULL; - dht_local_t *local = NULL; - - local = frame->local; - - conf = this->private; - - cold_subvol = subvol; - hot_subvol = conf->subvolumes[1]; - if (conf->subvolumes[0] != cold_subvol) { - hot_subvol = conf->subvolumes[0]; - } - /* - * 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); - - STACK_WIND (frame, dht_create_cbk, - cold_subvol, cold_subvol->fops->create, - loc, flags, mode, umask, fd, params); - } else { - local->params = dict_ref (params); - local->flags = flags; - local->mode = mode; - local->umask = umask; - local->cached_subvol = hot_subvol; - local->hashed_subvol = cold_subvol; - - gf_msg_debug (this->name, 0, - "creating %s on %s (link at %s)", loc->path, - hot_subvol->name, cold_subvol->name); - - dht_linkfile_create (frame, dht_create_linkfile_create_cbk, - this, hot_subvol, cold_subvol, loc); - - goto out; - } -out: - return 0; -} - - int dht_create_wind_to_avail_subvol (call_frame_t *frame, xlator_t *this, xlator_t *subvol, loc_t *loc, int32_t flags, @@ -6136,11 +6060,6 @@ dht_create_wind_to_avail_subvol (call_frame_t *frame, xlator_t *this, local = frame->local; - if (strcmp (this->type, "cluster/tier") == 0) - return dht_create_tier_wind_to_avail_subvol(frame, this, subvol, - loc, flags, mode, - umask, fd, params); - if (!dht_is_subvol_filled (this, subvol)) { gf_msg_debug (this->name, 0, "creating %s on %s", loc->path, |