Repository navigation
Fix stale IoTConsensus peers after restart during removal - #18892
Open
d-wang-commit wants to merge 1 commit into
Open
d-wang-commit wants to merge 1 commit into
d-wang-commit wants to merge 1 commit into
Conversation
d-wang-commit
marked this pull request as draft
October 15, 2026 09:46
d-wang-commit
marked this pull request as ready for review
October 16, 2026 11:11
Commit removal metadata before reconciling IoTConsensus V1 peer lists. Retry metadata updates and V1 resets up to three times before failing. Cover restart recovery and filter V1-only crash points in Ratis/V2 ITs.
d-wang-commit
force-pushed
the
fix-stale-peers-after-restart
branch
from
October 16, 2026 11:22
14b786c to
e68b2f9
Compare
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.
Description
Restart during peer removal
A surviving IoTConsensus V1 replica can restart after the removed peer's sync channel has been deleted but before ConfigNode commits the updated replica set. Its startup response still includes the removed peer, so it recreates that peer's dispatcher. Previously, completing the metadata update did not correct this recovered membership. Failed replication to the removed peer could then pin the minimum sync index and keep syncLag above zero.
Reconcile committed membership
Commit the replica-set removal before entering the new RESET_IOT_CONSENSUS_V1_PEER_LIST state. For IoTConsensus V1 DataRegions, send the final peer list to every retained replica through the existing resetPeerList RPC, including temporarily unavailable replicas. The existing DataNode handler waits for consensus startup before applying the list.
Metadata failures and unsuccessful V1 resets perform an initial attempt and up to three retries per state, sleeping five seconds between retries. Exhaustion marks the procedure as failed. The business state is persisted by the existing procedure framework and can resume after ConfigNode recovery; the in-memory cycle counter restarts after recovery. Existing state IDs are unchanged, and the new state is appended. No DataNode production code or RPC definitions are changed.
Ratis and IoTConsensus V2 crash ITs now exclude the V1-only state from their expected kill points. V1 retains coverage of the new state, and the assertion requiring all expected kill points to trigger is preserved.
Tests
Side effects and risks
This PR has:
Key changed/added classes (or packages if there are too many classes) in this PR