This is an automated email from the ASF dual-hosted git repository.
CRZbulabula pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new aa4b551befb Fix Integer overflow when converting 604800000000000ms to
-3942554432415203328ns (#17511)
aa4b551befb is described below
commit aa4b551befb9c8fcdb880503e27a8b9f8e1550f8
Author: libo <[email protected]>
AuthorDate: Sat Apr 18 00:47:07 2026 +0800
Fix Integer overflow when converting 604800000000000ms to
-3942554432415203328ns (#17511)
---
.../iotdb/commons/partition/SeriesPartitionTable.java | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/partition/SeriesPartitionTable.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/partition/SeriesPartitionTable.java
index da8952051e5..b388121fcd0 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/partition/SeriesPartitionTable.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/partition/SeriesPartitionTable.java
@@ -51,14 +51,6 @@ import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;
public class SeriesPartitionTable {
-
- // should only be used in CN scope, in DN scope should directly use
- // TimePartitionUtils.getTimePartitionInterval()
- private static final long TIME_PARTITION_INTERVAL =
- CommonDateTimeUtils.convertMilliTimeWithPrecision(
- TimePartitionUtils.getTimePartitionInterval(),
- CommonDescriptor.getInstance().getConfig().getTimestampPrecision());
-
private final ConcurrentSkipListMap<TTimePartitionSlot,
List<TConsensusGroupId>>
seriesPartitionMap;
@@ -263,13 +255,17 @@ public class SeriesPartitionTable {
*/
public List<TTimePartitionSlot> autoCleanPartitionTable(
long TTL, TTimePartitionSlot currentTimeSlot) {
+ final long timePartitionInterval =
+ CommonDateTimeUtils.convertMilliTimeWithPrecision(
+ TimePartitionUtils.getTimePartitionInterval(),
+
CommonDescriptor.getInstance().getConfig().getTimestampPrecision());
List<TTimePartitionSlot> removedTimePartitions = new ArrayList<>();
Iterator<Map.Entry<TTimePartitionSlot, List<TConsensusGroupId>>> iterator =
seriesPartitionMap.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<TTimePartitionSlot, List<TConsensusGroupId>> entry =
iterator.next();
TTimePartitionSlot timePartitionSlot = entry.getKey();
- if (timePartitionSlot.getStartTime() + TIME_PARTITION_INTERVAL + TTL
+ if (timePartitionSlot.getStartTime() + timePartitionInterval + TTL
<= currentTimeSlot.getStartTime()) {
removedTimePartitions.add(timePartitionSlot);
iterator.remove();