Fix schema partition lookup during ConfigNode removal - #18686
Merged
CRZbulabula merged 1 commit intoSep 21, 2026
Merged
CRZbulabula merged 1 commit into
CRZbulabula merged 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The change is small, aligns the table-model path with existing leadership-guarded behavior, and is backed by targeted integration tests covering the reported failure mode.
Review effort: Lite
Findings: None
What changed in this PR
This PR fixes table-model schema partition lookup behavior during ConfigNode removal by ensuring leadership/readiness is checked before reading consensus-backed schema partition state, so clients receive a retryable redirection status instead of a non-retryable execution error during the “deleted local ConfigRegion but process still alive” window.
Changes:
- Added a
confirmLeader()guard to the slot-based schema partition lookup path inConfigManager. - Added an integration test validating redirection/client recovery after deleting a follower’s local ConfigRegion while keeping its process/connection alive.
- Added an integration test validating continuous table read/write behavior while removing the current ConfigNode leader.
| File | Description |
|---|---|
| iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java | Adds a leadership/readiness check before serving slot-based schema partition lookups so removal/unready states return retryable status. |
| integration-test/src/test/java/org/apache/iotdb/confignode/it/removeconfignode/IoTDBRemoveConfigNodeSchemaPartitionIT.java | Adds IT coverage for client recovery on deleted ConfigRegion and for table workload continuity during leader removal. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Check ConfigNode leadership before reading schema partitions by slot. Add integration coverage for stale connections and reads/writes during leader removal.
d-wang-commit
force-pushed
the
fix-confignode-schema-partition-leader-check
branch
from
September 21, 2026 04:26
151dbd1 to
8c74a8f
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
Return retryable status during ConfigNode removal
A ConfigNode can still accept requests on existing connections after its local ConfigRegion has been deleted and before its process stops. The slot-based schema partition lookup previously read consensus state without checking leadership, returning EXECUTE_STATEMENT_ERROR (301). This response does not trigger the ConfigNode client's redirection retry.
Call confirmLeader() before reading schema partitions and return its status immediately when the node cannot serve the request. A removed node can return REDIRECTION_RECOMMEND (400) without a leader address, allowing the existing client retry logic to select another ConfigNode.
Tests
Side effects and risks
The tree-model schema partition lookup, getSchemaPartitionTable -> ConfigManager.getSchemaPartition(PathPatternTree, boolean), already calls confirmLeader(). This change adds the same guard to the corresponding table-model lookup, getSchemaPartitionTableWithSlots -> ConfigManager.getSchemaPartition(Map<String, List>), making the two entry paths consistent.
The guard also precedes the empty-database-map fast return. Requests reaching a follower or an unready leader may incur redirection or readiness-check latency. This reuses the existing leadership checks and client retry behavior; it changes no RPC schema, configuration, or persisted format.
This PR has:
Key changed/added classes (or packages if there are too many classes) in this PR