summaryrefslogtreecommitdiffstats
path: root/tests/tier.rc
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 /tests/tier.rc
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 'tests/tier.rc')
-rw-r--r--tests/tier.rc13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/tier.rc b/tests/tier.rc
index 3fa6af6a40f..4fd24de0659 100644
--- a/tests/tier.rc
+++ b/tests/tier.rc
@@ -99,3 +99,16 @@ function confirm_vol_stopped {
fi
}
+
+function sleep_first_cycle {
+ startTime=$(date +%s)
+ mod=$(( ( $startTime % $1 ) + 1 ))
+ sleep $mod
+}
+
+function sleep_until_mid_cycle {
+ startTime=$(date +%s)
+ mod=$(( ( $startTime % $1 ) + 1 ))
+ mod=$(( $mod + $1 / 2 ))
+ sleep $mod
+}