Skip to content

Fix AUTO RegionGroup replacement checks across region types - #19003

Merged
CRZbulabula merged 1 commit into
apache:masterfrom
d-wang-commit:fix-auto-region-group-extension-type
Oct 25, 2026
Merged

CRZbulabula merged 1 commit into
apache:masterfrom
d-wang-commit:fix-auto-region-group-extension-type

Conversation

@d-wang-commit

Copy link
Copy Markdown
Contributor

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

  • UT: added PartitionManagerAutoExtensionTest with six parameterized cases covering spurious replacement, missed replacement, and the maximum limit for both SchemaRegion and DataRegion. All six passed.
  • Ran 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.
  • Spotless passed for the changed files. The English reactor compilation completed with the UT run; mvn test-compile -pl iotdb-core/confignode -am -P with-zh-locale -DskipTests also passed.
  • IT: none added or run; this change is confined to the ConfigNode allocation condition.

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:

  • been self-reviewed.
  • added unit tests covering the changed allocation condition and maximum limit.

Key changed/added classes (or packages if there are too many classes) in this PR
  • PartitionManager: count only disabled RegionGroups of the requested type in AUTO replacement decisions.
  • PartitionManagerAutoExtensionTest: cover cross-type replacement and the maximum limit.

Count disabled groups only for the requested region type.
Add regression tests for spurious and missed replacement and the maximum limit.
@d-wang-commit
d-wang-commit marked this pull request as ready for review October 24, 2026 14:10
@CRZbulabula
CRZbulabula merged commit fd6b089 into apache:master Oct 25, 2026
38 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants