From dec8292a17f4d7543a4e22c293886363c97068b5 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 18 Aug 2020 17:18:25 -0400 Subject: [PATCH] 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 --- qa/workunits/rbd/rbd_mirror_helpers.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index b5c0a68c515ce..36d712f85b9c1 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 -- 2.39.5