summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/tier.c
diff options
context:
space:
mode:
authorDan Lambright <dlambrig@redhat.com>2015-11-01 10:22:00 -0500
committerDan Lambright <dlambrig@redhat.com>2015-11-07 10:30:22 -0800
commit06630972e786c205a485693f66039cd9bb10dc9d (patch)
tree598701dc560c971709d72bb4a778ea550e4ba241 /xlators/cluster/dht/src/tier.c
parenta88859127fbdebadb2895fb3d28eba3091c17cca (diff)
cluster/tier correct promotion cycle calculation
The tier translator should only choose candidate files for promotion from the most recent cycle, not a multiple of the most recent cycles. Otherwise user observed behavior can be inconsistent. Remove related test in tier.t that is subject to race condition. Change-Id: I9ad1523cac00f904097ce468efa6ddd515857024 BUG: 1275524 Signed-off-by: root <root@rhs-cli-15.gdev.lab.eng.bos.redhat.com> Signed-off-by: Dan Lambright <dlambrig@redhat.com> Reviewed-on: http://review.gluster.org/12480 Reviewed-by: Joseph Fernandes Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/dht/src/tier.c')
-rw-r--r--xlators/cluster/dht/src/tier.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c
index 51642e48970..b37c8edfdd5 100644
--- a/xlators/cluster/dht/src/tier.c
+++ b/xlators/cluster/dht/src/tier.c
@@ -28,7 +28,6 @@ static void *libhandle;
static gfdb_methods_t gfdb_methods;
#define DB_QUERY_RECORD_SIZE 4096
-#define PROMOTION_CYCLE_CNT 4
static int
@@ -1025,7 +1024,14 @@ tier_build_migration_qfile (demotion_args_t *args,
goto out;
}
time_in_past.tv_sec = current_time.tv_sec - time_in_past.tv_sec;
- time_in_past.tv_usec = current_time.tv_usec - time_in_past.tv_usec;
+
+ /* The migration daemon may run a varrying numberof usec after the sleep */
+ /* call triggers. A file may be registered in CTR some number of usec X */
+ /* after the daemon started and missed in the subsequent cycle if the */
+ /* daemon starts Y usec after the period in seconds where Y>X. Normalize */
+ /* away this problem by always setting usec to 0. */
+ time_in_past.tv_usec = 0;
+
gfdb_brick_info.time_stamp = &time_in_past;
gfdb_brick_info._gfdb_promote = is_promotion;
gfdb_brick_info._query_cbk_args = query_cbk_args;
@@ -1439,7 +1445,7 @@ tier_start (xlator_t *this, gf_defrag_info_t *defrag)
promotion_args.this = this;
promotion_args.brick_list = &bricklist_cold;
promotion_args.defrag = defrag;
- promotion_args.freq_time = freq_promote * PROMOTION_CYCLE_CNT;
+ promotion_args.freq_time = freq_promote;
ret_promotion = pthread_create (&promote_thread,
NULL, &tier_promote,
&promotion_args);