This is an automated email from the ASF dual-hosted git repository.
rong 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 6943524b000 Load: Trigger last flush time map & tsfile resource
degrading after successful load (#12024)
6943524b000 is described below
commit 6943524b000217bf6d4678b51097f93cfedad8f3
Author: Steve Yurong Su <[email protected]>
AuthorDate: Mon Feb 5 12:54:00 2024 +0800
Load: Trigger last flush time map & tsfile resource degrading after
successful load (#12024)
---
.../execution/load/LoadTsFileManager.java | 2 +-
.../db/storageengine/dataregion/DataRegion.java | 38 +++++++++++++++++++---
2 files changed, 35 insertions(+), 5 deletions(-)
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/load/LoadTsFileManager.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/load/LoadTsFileManager.java
index d7a87a3b219..4d2a92aff36 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/load/LoadTsFileManager.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/load/LoadTsFileManager.java
@@ -59,7 +59,7 @@ import java.util.concurrent.PriorityBlockingQueue;
/**
* {@link LoadTsFileManager} is used for dealing with {@link
LoadTsFilePieceNode} and {@link
* LoadCommand}. This class turn the content of a piece of loading TsFile into
a new TsFile. When
- * DataNode finish transfer pieces, this class will flush all TsFile and laod
them into IoTDB, or
+ * DataNode finish transfer pieces, this class will flush all TsFile and load
them into IoTDB, or
* delete all.
*/
public class LoadTsFileManager {
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
index b1398dba938..e8f451e2efb 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
@@ -2593,10 +2593,40 @@ public class DataRegion implements IDataRegionForQuery {
false,
newTsFileResource.getTsFile().getName());
- resetLastCacheWhenLoadingTsFile(); // update last cache
- updateLastFlushTime(newTsFileResource); // update last flush time
- long partitionNum = newTsFileResource.getTimePartition();
- updatePartitionFileVersion(partitionNum, newTsFileResource.getVersion());
+ // update last cache
+ resetLastCacheWhenLoadingTsFile();
+
+ // update last flush time & help last flush time map degrade
+ if (config.isEnableSeparateData()) {
+ final DataRegionId dataRegionId = new
DataRegionId(Integer.parseInt(this.dataRegionId));
+ final long timePartitionId = newTsFileResource.getTimePartition();
+ if
(!lastFlushTimeMap.checkAndCreateFlushedTimePartition(timePartitionId)) {
+ TimePartitionManager.getInstance()
+ .registerTimePartitionInfo(
+ new TimePartitionInfo(
+ dataRegionId,
+ timePartitionId,
+ false,
+ Long.MAX_VALUE,
+ lastFlushTimeMap.getMemSize(timePartitionId)));
+ }
+ updateLastFlushTime(newTsFileResource);
+ TimePartitionManager.getInstance()
+ .updateAfterFlushing(
+ dataRegionId,
+ timePartitionId,
+ System.currentTimeMillis(),
+ lastFlushTimeMap.getMemSize(timePartitionId),
+ false);
+ }
+
+ // update partition version
+ updatePartitionFileVersion(
+ newTsFileResource.getTimePartition(),
newTsFileResource.getVersion());
+
+ // help tsfile resource degrade
+
TsFileResourceManager.getInstance().registerSealedTsFileResource(newTsFileResource);
+
logger.info("TsFile {} is successfully loaded in unsequence list.",
newFileName);
} catch (DiskSpaceInsufficientException e) {
logger.error(