Repository navigation
Fix AUTO RegionGroup replacement checks across region types - #19003
Merged
CRZbulabula merged 1 commit intoOct 25, 2026
Merged
CRZbulabula merged 1 commit into
CRZbulabula merged 1 commit into
Conversation
Count disabled groups only for the requested region type. Add regression tests for spurious and missed replacement and the maximum limit.
d-wang-commit
marked this pull request as ready for review
October 24, 2026 14:10
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
Restrict AUTO replacement checks to the requested region type
When minimum-count and slot-based growth do not apply, AUTO compares the number of groups of the requested type with the number of disabled groups in the database. The latter currently includes both SchemaRegion and DataRegion groups.
With one running DataRegion group and one disabled SchemaRegion group, the equal counts incorrectly trigger a new DataRegion group. When both groups are disabled, the unequal counts prevent the required DataRegion replacement. SchemaRegion allocation has the same problem.
Filter the existing disabled-group list by the requested consensus group type before counting. This preserves the maximum limit and the existing behavior for missing status-cache entries without adding a new API.
Tests
PartitionManagerAutoExtensionTestwith six parameterized cases covering spurious replacement, missed replacement, and the maximum limit for both SchemaRegion and DataRegion. All six passed.mvn test -pl iotdb-core/confignode -am -Dtest=PartitionManagerAutoExtensionTest,PartitionManagerProactiveExtensionTest -Dsurefire.failIfNoSpecifiedTests=false: 60 passed, 6 skipped, no failures or errors. The skips are existing DataRegion-only cases under the SchemaRegion parameter.mvn test-compile -pl iotdb-core/confignode -am -P with-zh-locale -DskipTestsalso passed.Side effects and risks
Only AUTO replacement decisions in mixed-type databases change. The existing minimum, slot-based growth, maximum, and status-cache behavior are retained. Filtering adds a linear pass over the database's already selected disabled groups; no RPC, protocol, or persistence format changes are introduced.
This PR has:
Key changed/added classes (or packages if there are too many classes) in this PR