Skip to content

squid: rbd-mirror: prune obsolete primary mirror snapshots after relocation - #69767

Merged
batrick merged 3 commits into
ceph:squidfrom
abitdrag:wip-77526-squid
Jul 27, 2026
Merged

batrick merged 3 commits into
ceph:squidfrom
abitdrag:wip-77526-squid

Conversation

Prasanna Kumar Kalever and others added 2 commits June 26, 2026 15:11
Initialize the uuid member in the Peer constructor and include it in
stream output operator to ensure correct peer identification in logs.

Signed-off-by: Prasanna Kumar Kalever <[email protected]>
(cherry picked from commit e98037a)

Conflicts:
	src/tools/rbd_mirror/Types.h
- returning uuid as well in newer code
Previously, obsolete primary and demoted primary snapshots on the
secondary cluster were not cleaned up immediately after relocation.
Instead, old primary snapshots remained until a subsequent promote
operation triggered their cleanup, while old demoted primary snapshots
persisted until a later demote operation removed them.

Adding changes for proactive cleanup of obsolete primary and demoted
primary snapshots that are no longer required after relocation.

Also adding test coverage to validate the cleanup behavior.

Fixes: https://tracker.ceph.com/issues/76154

Signed-off-by: Miki Patel <[email protected]>
(cherry picked from commit a10f58d)

Conflicts:
	src/tools/rbd_mirror/Types.h
- combined peer UUID and metadata with improved naming
@abitdrag
abitdrag requested a review from a team as a code owner June 26, 2026 09:56
@abitdrag abitdrag added this to the squid milestone Jun 26, 2026
@abitdrag abitdrag added the rbd label Jun 26, 2026
@github-actions github-actions Bot added the tests label Jun 26, 2026
github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Jun 26, 2026
…al cluster

When an image is demoted on primary cluster and later promoted again,
a non-primary demoted image snapshot is created on the peer (secondary)
cluster. Each such promote/demote cycle on same cluster results in an
additional non-primary demoted snapshot being created on peer.
As a result, repeated promote/demote cycles on the same cluster can
lead to accumulation of stale non-primary demoted snapshots on the
secondary cluster. These snapshots are not removed immediately because
cleanup is only triggered when peer (secondary) is promoted and then
demoted.

The proposed changes ensures that such snapshots are proactively identified
and removed, preventing unbounded buildup. Also added test coverage to
verify cleanup behavior.

Fixes: https://tracker.ceph.com/issues/76155

Signed-off-by: Miki Patel <[email protected]>
(cherry picked from commit 5a77c4f)
@abitdrag

Copy link
Copy Markdown
Contributor Author

/audit retest

github-actions[bot]

This comment was marked as outdated.

@idryomov

Copy link
Copy Markdown
Contributor

Conflicts:
src/tools/rbd_mirror/Types.h

  • returning uuid as well in newer code

Conflicts:
src/tools/rbd_mirror/Types.h

  • combined peer UUID and metadata with improved naming

This basically explains what the new code is doing, but rather than that the conflict note should describe the origin of the conflict and, if it's not clear from the description alone, how the conflict was resolved. Here, the conflict (it's the same for both commits) is caused by std::ostream parameter getting renamed from lhs to os in commit 7cc08bf ("rbd-mirror: code cleanup") which isn't in squid. The resolution was to keep the old name.

@idryomov

Copy link
Copy Markdown
Contributor

jenkins test make check

@github-actions github-actions Bot removed the releng-audit-fail Release engineering: failed backport verification audit. label Jun 27, 2026
@idryomov

Copy link
Copy Markdown
Contributor

jenkins test make check

@abitdrag

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@yuriw

yuriw commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri2-testing-20260713.172617-squid.

@idryomov idryomov modified the milestones: squid, v19.2.6 Jul 20, 2026
@batrick
batrick merged commit 5f66782 into ceph:squid Jul 27, 2026
13 of 14 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