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>
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
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