d-wang-commit commented on code in PR #18692:
URL: https://github.com/apache/iotdb/pull/18692#discussion_r4072984622
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/DatabasePartitionTable.java:
##########
@@ -267,6 +268,18 @@ public int getAssignedSeriesPartitionSlotsCount() {
dataPartitionTable.getDataPartitionMap().size());
}
+ /** Count distinct series slots after allocation, independently for schema
and data partitions. */
+ public int getSeriesPartitionSlotsCount(
+ TConsensusGroupType type, Collection<TSeriesPartitionSlot>
unassignedSlots) {
+ final Set<TSeriesPartitionSlot> assignedSlots =
+ type == TConsensusGroupType.SchemaRegion
+ ? schemaPartitionTable.getSchemaPartitionMap().keySet()
+ : dataPartitionTable.getDataPartitionMap().keySet();
Review Comment:
This is a corner case that empty entries can slightly inflate the
active-slot count and cause unnecessary RegionGroup creation, but the
configured maximum still caps growth. It does not affect partition allocation
correctness.
We will leave this unchanged.
--
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]