From: Jason Dillaman Date: Tue, 18 Aug 2020 21:18:25 +0000 (-0400) Subject: qa/workunits/rbd: retrieve peer uuid when attempting to delete duplicate X-Git-Tag: wip-pdonnell-testing-20200918.022351~289^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=dec8292a17f4d7543a4e22c293886363c97068b5;p=ceph-ci.git qa/workunits/rbd: retrieve peer uuid when attempting to delete duplicate Previously, the peer uuid variable was empty which resulted in the failure to remove the duplicate peer. Fixes: https://tracker.ceph.com/issues/47007 Signed-off-by: Jason Dillaman --- diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index b5c0a68c515..36d712f85b9 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -238,6 +238,7 @@ peer_add() local cluster=$1 ; shift local pool=$1 ; shift local client_cluster=$1 ; shift + local remote_cluster="${client_cluster##*@}" local uuid_var_name if [ -n "$1" ]; then @@ -257,6 +258,9 @@ peer_add() if [ $error_code -eq 17 ]; then # raced with a remote heartbeat ping -- remove and retry sleep $s + peer_uuid=$(rbd mirror pool info --cluster ${cluster} --pool ${pool} --format xml | \ + xmlstarlet sel -t -v "//peers/peer[site_name='${remote_cluster}']/uuid") + rbd --cluster ${cluster} --pool ${pool} mirror pool peer remove ${peer_uuid} else test $error_code -eq 0