summaryrefslogtreecommitdiffstats
path: root/src/test/cls_rbd
diff options
context:
space:
mode:
authorChristopher Hoffman <choffman@redhat.com>2023-04-19 17:26:27 +0200
committerChristopher Hoffman <choffman@redhat.com>2023-05-08 16:33:49 +0200
commitac552c9b4d65198db8038d397a3060d5a030917d (patch)
tree7a1040a6caff48a6c3e393e1c7b13c3fae3a2d2a /src/test/cls_rbd
parentMerge pull request #51030 from batrick/i59425 (diff)
downloadceph-ac552c9b4d65198db8038d397a3060d5a030917d.tar.xz
ceph-ac552c9b4d65198db8038d397a3060d5a030917d.zip
librbd: localize snap_remove op for mirror snapshots
A client may attempt a lock request not quickly enough to obtain exclusive lock for operations when another competing client responds quicker. This can happen when a peer site has different performance characteristics or latency. Instead of relying on this unpredictable behavior, localize operation to primary cluster. Fixes: https://tracker.ceph.com/issues/59393 Signed-off-by: Christopher Hoffman <choffman@redhat.com>
Diffstat (limited to 'src/test/cls_rbd')
-rw-r--r--src/test/cls_rbd/test_cls_rbd.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/cls_rbd/test_cls_rbd.cc b/src/test/cls_rbd/test_cls_rbd.cc
index 4d6f9bd89b0..2f553a0f433 100644
--- a/src/test/cls_rbd/test_cls_rbd.cc
+++ b/src/test/cls_rbd/test_cls_rbd.cc
@@ -2275,14 +2275,14 @@ TEST_F(TestClsRbd, mirror_snapshot) {
ASSERT_EQ(1U, sn->mirror_peer_uuids.size());
ASSERT_EQ(1U, sn->mirror_peer_uuids.count("peer2"));
- ASSERT_EQ(-ERESTART,
- mirror_image_snapshot_unlink_peer(&ioctx, oid, 1, "peer2"));
+ ASSERT_EQ(0, mirror_image_snapshot_unlink_peer(&ioctx, oid, 1, "peer2"));
+ ASSERT_EQ(-ENOENT, mirror_image_snapshot_unlink_peer(&ioctx, oid, 1,
+ "peer2"));
ASSERT_EQ(0, snapshot_get(&ioctx, oid, 1, &snap));
sn = std::get_if<cls::rbd::MirrorSnapshotNamespace>(
&snap.snapshot_namespace);
ASSERT_NE(nullptr, sn);
- ASSERT_EQ(1U, sn->mirror_peer_uuids.size());
- ASSERT_EQ(1U, sn->mirror_peer_uuids.count("peer2"));
+ ASSERT_EQ(0U, sn->mirror_peer_uuids.size());
ASSERT_EQ(0, snapshot_get(&ioctx, oid, 2, &snap));
auto nsn = std::get_if<cls::rbd::MirrorSnapshotNamespace>(