Copilot commented on code in PR #18692:
URL: https://github.com/apache/iotdb/pull/18692#discussion_r4072218741


##########
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:
   `dataPartitionTable.getDataPartitionMap().keySet()` includes empty 
`SeriesPartitionTable` entries created by `filterUnassignedDataPartitionSlots` 
before region/partition allocation. If that allocation fails (or a slot is 
emptied by TTL cleanup), the key remains without any persisted assignment, so a 
later request for a different slot counts it toward the PROACTIVE target and 
can create an extra RegionGroup. Count only data entries with at least one time 
partition here, while still unioning the current pending slots below.



-- 
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]

Reply via email to