d-wang-commit commented on code in PR #18692:
URL: https://github.com/apache/iotdb/pull/18692#discussion_r4070425472
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java:
##########
@@ -645,16 +647,60 @@ private TSStatus extendRegionGroupIfNecessary(
return result;
}
+ private TSStatus proactiveExtendRegionGroupIfNecessary(
+ final Map<String, ? extends Collection<TSeriesPartitionSlot>>
unassignedPartitionSlotsMap,
+ final TConsensusGroupType consensusGroupType)
+ throws DatabaseNotExistsException, NotEnoughDataNodeException {
+ final Map<String, Integer> allotmentMap = new HashMap<>();
+ for (Map.Entry<String, ? extends Collection<TSeriesPartitionSlot>> entry :
+ unassignedPartitionSlotsMap.entrySet()) {
+ final String database = entry.getKey();
+ final int maxRegionGroupCount =
+ getClusterSchemaManager().getMaxRegionGroupNum(database,
consensusGroupType);
+ final int minRegionGroupCount =
+ getClusterSchemaManager().getMinRegionGroupNum(database,
consensusGroupType);
+ final int allocatedRegionGroupCount =
+ partitionInfo.getRegionGroupCount(database, consensusGroupType);
+ // As with AUTO, grow toward the minimum by at most the number of
pending series slots.
+ // An existing data slot with new time partitions also contributes to
this incremental growth.
+ final int minimumRegionGroupTarget =
+ Math.min(minRegionGroupCount, allocatedRegionGroupCount +
entry.getValue().size());
Review Comment:
Fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]