summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Fernandes <josferna@redhat.com>2015-05-03 12:41:40 +0530
committerVijay Bellur <vbellur@redhat.com>2015-05-10 01:06:27 -0700
commit46d353f9e4b9c6a0a330ccab914d1668ce5dced7 (patch)
treebd1049b6f5cce41569cd039c2317fd94cb4a80ce
parent2b7048a58ced7dea2d40016b5c6880fcca89f0f0 (diff)
dht/tier/rebalancer: Fix reset of tiering client pid
In the patch http://review.gluster.org/#/c/9657 the client pid set by tiering migration was getting over- written in dht_start_rebalance_task(). Just corrected it in dht_setxattr() before calling dht_start_rebalance_task() and removed it from dht_start_rebalance_task(). > http://review.gluster.org/#/c/10502/ > Cherry picked from commit a5fe0f594d41e1a11661d9074bb19e9c2e2c4776 > Change-Id: I37cfa111f83a4e5d498042575c93799f60b49870 > BUG: 1217937 > Signed-off-by: Joseph Fernandes <josferna@redhat.com> > Reviewed-on: http://review.gluster.org/10502 > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Susant Palai <spalai@redhat.com> > Reviewed-by: Dan Lambright <dlambrig@redhat.com> Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/10502 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Susant Palai <spalai@redhat.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Signed-off-by: Joseph Fernandes <josferna@redhat.com> Conflicts: xlators/cluster/dht/src/dht-common.c xlators/cluster/dht/src/tier.c Change-Id: Id513114c9a880c6196162dd4b35bbf1155a8cd09 BUG: 1219027 Reviewed-on: http://review.gluster.org/10609 Reviewed-by: N Balachandran <nbalacha@redhat.com> Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--xlators/cluster/dht/src/dht-common.c4
-rw-r--r--xlators/cluster/dht/src/dht-common.h1
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c1
-rw-r--r--xlators/cluster/dht/src/tier.c2
4 files changed, 5 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 37e07ad77da..20ad4f2bd72 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -3491,9 +3491,11 @@ dht_setxattr (call_frame_t *frame, xlator_t *this,
* data migration and set the frame->root->pid to
* GF_CLIENT_PID_TIER_DEFRAG in dht_setxattr() just before
* calling dht_start_rebalance_task() */
- tmp = dict_get (xattr, "tiering.migration");
+ tmp = dict_get (xattr, TIERING_MIGRATION_KEY);
if (tmp)
frame->root->pid = GF_CLIENT_PID_TIER_DEFRAG;
+ else
+ frame->root->pid = GF_CLIENT_PID_DEFRAG;
ret = dht_start_rebalance_task (this, frame);
if (!ret)
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h
index 45b6cc9e80b..7a5d40f9be2 100644
--- a/xlators/cluster/dht/src/dht-common.h
+++ b/xlators/cluster/dht/src/dht-common.h
@@ -32,6 +32,7 @@
#define DHT_FILE_MIGRATE_DOMAIN "dht.file.migrate"
#define DHT_LAYOUT_HEAL_DOMAIN "dht.layout.heal"
#define DHT_LAYOUT_HASH_INVALID 1
+#define TIERING_MIGRATION_KEY "tiering.migration"
#include <fnmatch.h>
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index fae856d969f..9c42af934e4 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -1383,7 +1383,6 @@ dht_start_rebalance_task (xlator_t *this, call_frame_t *frame)
{
int ret = -1;
- frame->root->pid = GF_CLIENT_PID_DEFRAG;
ret = synctask_new (this->ctx->env, rebalance_task,
rebalance_task_completion,
frame, frame);
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c
index 92d13f4f04b..2526604eaba 100644
--- a/xlators/cluster/dht/src/tier.c
+++ b/xlators/cluster/dht/src/tier.c
@@ -232,7 +232,7 @@ tier_migrate_using_query_file (void *_args)
* GF_CLIENT_PID_TIER_DEFRAG in dht_setxattr() just before
* calling dht_start_rebalance_task() */
per_file_status = dict_set_str (migrate_data,
- "tiering.migration", "yes");
+ TIERING_MIGRATION_KEY, "yes");
if (per_file_status) {
goto per_file_out;
}