Fix ConfigNode leader transfer retries during removal - #18348
Merged
CRZbulabula merged 1 commit intoJul 29, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Improves ConfigNode removal robustness by making leader-transfer handling resilient to transient Ratis transfer failures and by redirecting the request to the actual elected leader after transfer attempts.
Changes:
- Enhance
NodeManager.transferLeaderto try all running followers in deterministic ConfigNode ID order, retrying only transientRatisRequestFailedExceptions and confirming the actual leader after each attempt. - Add unit tests covering transient failures, ambiguous transfer outcomes (transfer throws but leader changes), exhausted candidates, and non-retriable exceptions.
- Update the ConfigNode removal integration-test framework to explicitly remove the current ConfigNode leader.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/NodeManager.java | Adds deterministic multi-candidate leader-transfer attempts with transient-failure retry and post-transfer leader verification/redirect. |
| iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/manager/node/NodeManagerTest.java | New unit tests validating retry/fallback behavior and correct redirection semantics. |
| iotdb-core/confignode/src/main/i18n/en/org/apache/iotdb/confignode/i18n/ManagerMessages.java | Adds i18n log templates for new leader-transfer retry/verification warnings. |
| iotdb-core/confignode/src/main/i18n/zh/org/apache/iotdb/confignode/i18n/ManagerMessages.java | Chinese i18n equivalents for the new log templates. |
| integration-test/src/test/java/org/apache/iotdb/confignode/it/removeconfignode/IoTDBRemoveConfigNodeITFramework.java | Adjusts removal target selection to remove the current leader based on the environment’s leader wrapper and SHOW CONFIGNODES. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
This change makes removing the current ConfigNode leader resilient to transient Ratis leadership transfer failures.
Previously, the removal pre-check selected a single running follower and failed immediately when
transferLeaderreturned an error. A transient election timeout could therefore abort the removal even when another healthy ConfigNode was available. The code also redirected to the requested transfer target without verifying which ConfigNode was actually elected.This PR:
RatisRequestFailedExceptionfailuresThis fixes V2-1059.
Tests
mvn test -pl iotdb-core/confignode -Dtest=NodeManagerTestmvn test-compile -DskipTestsmvn test-compile -DskipTests -P with-zh-localemvn verify -DskipUTs -Dit.test=IoTDBRemoveConfigNodeNormalIT -DfailIfNoTests=false -Dfailsafe.failIfNoSpecifiedTests=false -pl integration-test -am -PClusterIT -P with-integration-tests