Skip to content

test(admin): cover orphan resync status cleanup#2816

Merged
overtrue merged 1 commit into
mainfrom
codex/test-site-resync-orphan-cleanup
May 6, 2026
Merged

test(admin): cover orphan resync status cleanup#2816
overtrue merged 1 commit into
mainfrom
codex/test-site-resync-orphan-cleanup

Conversation

@overtrue
Copy link
Copy Markdown
Collaborator

@overtrue overtrue commented May 5, 2026

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_status entries whose deployment IDs no longer exist in peers, 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_sites with 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_site
  • cargo fmt --all
  • cargo fmt --all --check
  • make pre-commit

Impact

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.

Copilot AI review requested due to automatic review settings May 5, 2026 17:20
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

CLA requirements are satisfied for this pull request.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_status entry.
  • Verifies remove_sites leaves active peer state intact while dropping the orphaned resync_status entry when called with a non-existent site name.

@overtrue overtrue marked this pull request as ready for review May 5, 2026 17:42
@overtrue overtrue added this pull request to the merge queue May 6, 2026
Merged via the queue into main with commit c228fab May 6, 2026
12 checks passed
@overtrue overtrue deleted the codex/test-site-resync-orphan-cleanup branch May 6, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants