]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rbd: retrieve peer uuid when attempting to delete duplicate 36707/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 18 Aug 2020 21:18:25 +0000 (17:18 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 18 Aug 2020 21:18:25 +0000 (17:18 -0400)
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 <dillaman@redhat.com>
qa/workunits/rbd/rbd_mirror_helpers.sh

index b5c0a68c515ce7a3e4649cd26401fbfbdd35eb62..36d712f85b9c186d20fd46a9adfa4b061ac15d1d 100755 (executable)
@@ -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