From 2f9e6412982826fe0712a0b98e004c405b60fac3 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Wed, 14 Sep 2016 08:49:39 -0400 Subject: [PATCH] qa/workunits/rbd: fix remove mirrored image race conditions Signed-off-by: Jason Dillaman (cherry picked from commit a0f65b968b350629dfad978c191fc878ca26d093) --- qa/workunits/rbd/rbd_mirror.sh | 2 +- qa/workunits/rbd/rbd_mirror_helpers.sh | 1 + qa/workunits/rbd/rbd_mirror_stress.sh | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/qa/workunits/rbd/rbd_mirror.sh b/qa/workunits/rbd/rbd_mirror.sh index 4ce92fc4eee9..19337317e238 100755 --- a/qa/workunits/rbd/rbd_mirror.sh +++ b/qa/workunits/rbd/rbd_mirror.sh @@ -202,7 +202,7 @@ for i in ${image3} ${image5}; do remove_snapshot ${CLUSTER2} ${POOL} ${i} 'snap2' # workaround #16555: before removing make sure it is not still bootstrapped wait_for_image_replay_started ${CLUSTER1} ${POOL} ${i} - remove_image ${CLUSTER2} ${POOL} ${i} + remove_image_retry ${CLUSTER2} ${POOL} ${i} done for i in ${image2} ${image3} ${image4} ${image5}; do diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index d7d06d7a7dac..e28c9c988c49 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -498,6 +498,7 @@ remove_image() local pool=$2 local image=$3 + rbd --cluster=${cluster} -p ${pool} snap purge ${image} rbd --cluster=${cluster} -p ${pool} rm ${image} } diff --git a/qa/workunits/rbd/rbd_mirror_stress.sh b/qa/workunits/rbd/rbd_mirror_stress.sh index 1caea2332607..0aeaa692fa89 100755 --- a/qa/workunits/rbd/rbd_mirror_stress.sh +++ b/qa/workunits/rbd/rbd_mirror_stress.sh @@ -98,7 +98,7 @@ for i in `seq 1 10` do stress_write_image ${CLUSTER2} ${POOL} ${image} - test_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position' + wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position' snap_name="snap${i}" create_snap ${CLUSTER2} ${POOL} ${image} ${snap_name} @@ -112,7 +112,7 @@ do remove_snapshot ${CLUSTER2} ${POOL} ${image} ${snap_name} done -remove_image ${CLUSTER2} ${POOL} ${image} +remove_image_retry ${CLUSTER2} ${POOL} ${image} wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted' testlog "TEST: create many images" @@ -150,7 +150,7 @@ for i in `seq 1 ${IMAGE_COUNT}` do image="image_${i}" remove_snapshot ${CLUSTER2} ${POOL} ${image} ${snap_name} - remove_image ${CLUSTER2} ${POOL} ${image} + remove_image_retry ${CLUSTER2} ${POOL} ${image} done testlog "TEST: image deletions should propagate" -- 2.47.3