From 103eee4d13ae05f4b417b48a6cda5463482b721d Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Sun, 21 Feb 2016 19:42:54 +0200 Subject: [PATCH] test: image_replay: use flush to speedup commit position update Signed-off-by: Mykola Golub --- qa/workunits/rbd/rbd_mirror_image_replay.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/qa/workunits/rbd/rbd_mirror_image_replay.sh b/qa/workunits/rbd/rbd_mirror_image_replay.sh index bf496f4c01c2..f0ef8d5ed934 100755 --- a/qa/workunits/rbd/rbd_mirror_image_replay.sh +++ b/qa/workunits/rbd/rbd_mirror_image_replay.sh @@ -96,10 +96,21 @@ stop_replay() RBD_IMAGE_REPLAY_PID_FILE= } +flush() +{ + local cmd + + cmd=$(ceph --admin-daemon ${TEMPDIR}/rbd-mirror-image-replay.asok help | + sed -nEe 's/^.*"(rbd mirror flush [^"]*)":.*$/\1/p') + test -n "${cmd}" + ceph --admin-daemon ${TEMPDIR}/rbd-mirror-image-replay.asok ${cmd} +} + wait_for_replay_complete() { for s in 0.2 0.4 0.8 1.6 2 2 4 4 8; do sleep ${s} + flush local status_log=${TEMPDIR}/${RMT_POOL}-${IMAGE}.status rbd -p ${RMT_POOL} journal status --image ${IMAGE} | tee ${status_log} local master_pos=`sed -nEe 's/^.*id=,.*entry_tid=([0-9]+).*$/\1/p' ${status_log}` @@ -131,7 +142,7 @@ wait_for_replay_complete stop_replay compare_images -count=32 +count=10 rbd -p ${RMT_POOL} bench-write ${IMAGE} --io-size 4096 --io-threads 1 \ --io-total $((4096 * count)) --io-pattern seq start_replay -- 2.47.3