test(admin): cover orphan resync status cleanup#2816
Merged
Conversation
Contributor
|
CLA requirements are satisfied for this pull request. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a targeted regression test in the admin site-replication handler to ensure remove_sites continues to prune orphaned resync_status entries even when the requested site name does not match any current peer.
Changes:
- Introduces a unit test that constructs a state with valid peers plus an orphaned
resync_statusentry. - Verifies
remove_sitesleaves active peer state intact while dropping the orphanedresync_statusentry when called with a non-existent site name.
houseme
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
N/A
Summary of Changes
This adds focused regression coverage for site replication remove state cleanup.
Recent remove-site logic now prunes
resync_statusentries whose deployment IDs no longer exist inpeers, even when the requested site name does not match any current peer. Without a dedicated test, that orphan-status cleanup path could regress while the removed-peer and local-site removal tests still pass.The new unit test builds a state with two active peers plus one orphaned resync status, calls
remove_siteswith a missing site name, and verifies active peer state remains intact while the orphaned resync status is removed.Verification
cargo test -p rustfs test_remove_sites_prunes_orphan_resync_status_without_matching_sitecargo fmt --allcargo fmt --all --checkmake pre-commitImpact
No user-facing behavior change. This is test-only coverage for existing site replication cleanup behavior.
Additional Notes
N/A
Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md). If this is your first contribution, review the CLA document and sign it by commenting
I have read and agree to the CLA.on the PR.