Add proactive RegionGroup allocation and policy hot reload - #18692
Open
d-wang-commit wants to merge 1 commit into
Open
d-wang-commit wants to merge 1 commit into
d-wang-commit wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
One or more issues must be addressed before approval.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Adds proactive Schema/Data RegionGroup allocation and policy hot reload, with slot-aware balancing and recovery behavior.
Changes:
- Adds PROACTIVE policy, defaults, and documentation.
- Implements distinct-slot allocation and active-slot retention.
- Adds hot-reload handling plus extensive unit/integration tests.
| File | Description |
|---|---|
| iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template | Updated as part of this pull request. |
| iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/manager/partition/PartitionManagerProactiveExtensionTest.java | Updated as part of this pull request. |
| iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/manager/load/balancer/partition/DataPartitionPolicyTableProactiveTest.java | Updated as part of this pull request. |
| iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/conf/RegionGroupExtensionPolicyConfigTest.java | Updated as part of this pull request. |
| iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java | Updated as part of this pull request. |
| iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/DatabasePartitionTable.java | Updated as part of this pull request. |
| iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/RegionGroupExtensionPolicy.java | Updated as part of this pull request. |
| iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java | Updated as part of this pull request. |
| iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/partition/DataPartitionPolicyTable.java | Updated as part of this pull request. |
| iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java | Updated as part of this pull request. |
| iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java | Updated as part of this pull request. |
| integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBProactiveRegionGroupExtensionIT.java | Updated as part of this pull request. |
| integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBProactiveRegionGroupDistributionIT.java | Updated as part of this pull request. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
CRZbulabula
requested changes
Sep 22, 2026
d-wang-commit
force-pushed
the
add_proactive_region_group_extension_policy
branch
2 times, most recently
from
September 22, 2026 10:42
8088887 to
d54ff28
Compare
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Empty partition entries can cause incorrect proactive RegionGroup allocation.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Resolved since last review (1)
…to the maximum RegionGroup number. Cover allocation, recovery, and policy switching with unit and integration tests.
d-wang-commit
force-pushed
the
add_proactive_region_group_extension_policy
branch
from
September 22, 2026 15:09
d54ff28 to
22231b1
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
Policy use cases
The configuration template describes the intended scenarios as follows (quoted verbatim).
SchemaRegionGroups/DataRegionGroups:
Proactive RegionGroup allocation
Sparse databases can keep using only a few RegionGroups under AUTO even when resources are available. Add PROACTIVE for SchemaRegionGroups and DataRegionGroups, and make it the default in ConfigNodeConfig and the configuration template.
PROACTIVE counts distinct persisted and pending series slots separately for schema and data. It grows toward one group per active slot, respects the resource-derived maximum, and follows AUTO's configured minimum. If all groups of the requested type are disabled, one RegionGroup can be allocated within the maximum.
For data allocation and recovery, calculate the retained-slot limit from active assignments, with a minimum of one, instead of the total configured slot count. With 1,000 slots and six active devices, switching from AUTO (with two existing groups) to PROACTIVE can grow to six groups: each old group retains 1 slot and 4 slots (got unassigned first) then use the 4 new groups for new partitions.
Policy hot reload
Leaving CUSTOM refreshes resource caps in all cases.
CUSTOM's maximum cannot be lowered, even to the current group count.
Expansion requires subsequent partition allocation; historical partitions stay unchanged.
Tests
Added UTs:
Existing ClusterSchemaManagerTest and DataPartitionPolicyTableTest provide resource-limit and allocation regression coverage.
Added ITs:
The recorded local targeted run completed with 65 UT cases (0 failures, 0 errors, 3 skipped) and all six hot-reload IT cases passing. The topology matrix and existing IoTDBPartitionInheritStrategyIT were not part of that run.
Side effects and risks
Changing the default from AUTO to PROACTIVE can create more RegionGroups earlier, increasing consensus, memory, and storage overhead within resource limits. Explicit AUTO and CUSTOM settings remain available. Policy changes can affect placement of newly allocated partitions, but do not migrate historical data or shrink existing groups. Allocation may still fail when insufficient DataNodes are available.
This PR has:
for an unfamiliar reader.
Key changed/added classes (or packages if there are too many classes) in this PR