Skip to content

control-connection: run topology removals through cluster - #1036

Draft
dkropachev wants to merge 1 commit into
fix/removed-host-down-workfrom
fix/topology-removal-lifecycle
Draft

dkropachev wants to merge 1 commit into
fix/removed-host-down-workfrom
fix/topology-removal-lifecycle

Conversation

@dkropachev

Copy link
Copy Markdown

Problem

Node-list reconciliation removes absent host IDs directly from metadata. That bypasses the cluster removal lifecycle, leaving session pools, load-balancing policies, listeners, control-connection state, and metrics associated with the removed host active.

Host-ID reindexing adds two constraints: stale metadata aliases must be removed without tearing down the still-registered Host, and overlapping refreshes must not interleave reindexing with removal lifecycle work.

Fix

Route absent snapshot IDs through a cluster removal entry point that performs lifecycle cleanup without recursively starting another topology refresh. Preserve a Host that remains registered under a new ID, and serialize node-list refreshes so reindexing and stale-ID cleanup cannot overlap.

Fixes #1007

Dependency

This draft is stacked on #1035 for the exact-Host registration helper. #1035 is itself stacked on #1032. Retarget this PR after the preceding drafts merge.

Testing

  • TZ=UTC uv run pytest -q tests/unit/test_cluster.py tests/unit/test_control_connection.py — 122 passed
  • git diff --check

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce. (Not applicable: no public items added.)
  • I have adjusted the documentation in ./docs/source/. (Not applicable: internal topology lifecycle fix.)
  • I added appropriate Fixes: annotations to PR description.

Node-list refresh removed missing host IDs directly from metadata, bypassing session, policy, listener, and control-connection cleanup.

Route snapshot removals through Cluster without recursively refreshing, preserve Hosts reindexed under a new ID, and serialize overlapping refreshes so stale cleanup cannot tear down a live host.

Fixes #1007
@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

1 participant