Skip to content

squid: rbd-mirror: prevent image deletion if remote image is not primary#64739

Merged
yuriw merged 2 commits intoceph:squidfrom
VinayBhaskar-V:wip-72319-squid
Oct 2, 2025
Merged

squid: rbd-mirror: prevent image deletion if remote image is not primary#64739
yuriw merged 2 commits intoceph:squidfrom
VinayBhaskar-V:wip-72319-squid

Conversation

@VinayBhaskar-V
Copy link
Copy Markdown
Contributor

@VinayBhaskar-V VinayBhaskar-V commented Jul 29, 2025

backport tracker: https://tracker.ceph.com/issues/72319


backport of #63270 and #64757
parent tracker: https://tracker.ceph.com/issues/70948

this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh

@VinayBhaskar-V VinayBhaskar-V requested a review from a team as a code owner July 29, 2025 13:51
@VinayBhaskar-V VinayBhaskar-V added this to the squid milestone Jul 29, 2025
@github-actions github-actions bot added the tests label Jul 29, 2025
@idryomov
Copy link
Copy Markdown
Contributor

idryomov commented Aug 1, 2025

Appended #64757 (unit test fixup).

@sunilangadi2
Copy link
Copy Markdown

@yuriw can you please take this PR testing for your any squid batch

A resync on a mirrored image may incorrectly results in the local
image being deleted even when the remote image is no longer primary.
This issue can occur under the following conditions:
* if  resync is requested on the secondary before the remote image has
  been fully demoted
* if the demotion of the primary image is not mirrored
  due to the rbd-mirror daemon being offline.

This can be fixed by ensuring that image deletion during a resync is
only allowed when the remote image is confirmed to be primary.

This commit fixes the issue only for snapshot based mirroring mode

Fixes: https://tracker.ceph.com/issues/70948
Signed-off-by: VinayBhaskar-V <vvarada@redhat.com>
(cherry picked from commit e14afbc)
Adjust the wait_for_notification call in TestMockImageReplayerSnapshotReplayer.ResyncRequestedRemoteNotPrimary
to expect 2 notifications instead of 1. This allows the test to correctly wait for both expected events
i.e for finish_sync() and handle_replay_complete(locker, -EREMOTEIO, "remote image demoted"), ensuring the
replayer transitions to STATE_COMPLETE and is_replaying() returns false as intended.

Fixes: https://tracker.ceph.com/issues/72325
Signed-off-by: VinayBhaskar-V <vvarada@redhat.com>
(cherry picked from commit b5a013f)
@VinayBhaskar-V
Copy link
Copy Markdown
Contributor Author

jenkins test api

@VinayBhaskar-V
Copy link
Copy Markdown
Contributor Author

jenkins test make check

@yuriw
Copy link
Copy Markdown
Contributor

yuriw commented Oct 2, 2025

jenkins test make check

@yuriw yuriw merged commit e72c769 into ceph:squid Oct 2, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants