Repository navigation
Fix stale IoTConsensus peers after restart during removal - #18892
Draft
d-wang-commit wants to merge 1 commit into
Draft
d-wang-commit wants to merge 1 commit into
d-wang-commit wants to merge 1 commit into
Conversation
Reconcile retained replicas after committing peer removal in ConfigNode. Persist and retry finalization until every retained replica acknowledges. Cover stale-peer restart recovery and procedure timeout scheduling.
d-wang-commit
marked this pull request as draft
October 15, 2026 09:46
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 IoTConsensus peer removal
A surviving replica can restart after the removed peer's sync channel has been deleted but before ConfigNode commits the updated replica set. The restart response still includes the removed peer, so IoTConsensus recreates its dispatcher. Previously, completing the metadata update did not correct that recovered peer list. Replication to the removed peer kept failing and pinned the minimum sync index, leaving syncLag above zero.
Reconcile before completing removal
For IoTConsensus V1 DataRegions, commit the replica-set removal first, then use the existing resetPeerList RPC to send the final membership to every retained replica. The existing DataNode handler waits for consensus startup before applying the list. Finish the procedure only after every retained replica acknowledges success.
Metadata failures, missing or unsuccessful responses, and exceptions keep the existing final state pending and retry after a five-second timeout. Offline replicas are included. ProcedureExecutor registers the timeout after persisting the suspended state, allowing retries to resume automatically and after recovery. No procedure state IDs, serialized fields, DataNode production code, or RPC definitions are changed.
Tests
Side effects and risks
This PR has:
Key changed/added classes (or packages if there are too many classes) in this PR