You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2024/11/27 01:46:00 UTC
(iotdb) 01/01: try to fix LastFlushTimeMapTest
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch fix_last_flush_time_map_test
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 98dddf8a413daf7c0eee57549e30a81c4cf6c4e2
Author: HTHou <hh...@outlook.com>
AuthorDate: Wed Nov 27 09:45:25 2024 +0800
try to fix LastFlushTimeMapTest
---
.github/workflows/unit-test.yml | 1 +
.../storageengine/dataregion/memtable/TsFileProcessor.java | 1 +
.../db/storageengine/dataregion/LastFlushTimeMapTest.java | 13 +------------
3 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml
index ff3017806c2..390805c9518 100644
--- a/.github/workflows/unit-test.yml
+++ b/.github/workflows/unit-test.yml
@@ -9,6 +9,7 @@ on:
- master
- 'rel/*'
- "rc/*"
+ - fix_last_flush_time_map_test
paths-ignore:
- 'docs/**'
- 'site/**'
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java
index 7bd09293d76..f5c176521aa 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java
@@ -1311,6 +1311,7 @@ public class TsFileProcessor {
* TODO if the flushing thread is too fast, the tmpMemTable.wait() may never wakeup Tips: I am
* trying to solve this issue by checking whether the table exist before wait()
*/
+ @TestOnly
public void syncFlush() throws IOException {
IMemTable tmpMemTable;
flushQueryLock.writeLock().lock();
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/LastFlushTimeMapTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/LastFlushTimeMapTest.java
index eb40f66a6d0..397ed6037ac 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/LastFlushTimeMapTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/LastFlushTimeMapTest.java
@@ -25,7 +25,6 @@ import org.apache.iotdb.db.exception.DataRegionException;
import org.apache.iotdb.db.exception.WriteProcessException;
import org.apache.iotdb.db.storageengine.StorageEngine;
import org.apache.iotdb.db.storageengine.dataregion.compaction.schedule.CompactionTaskManager;
-import org.apache.iotdb.db.storageengine.dataregion.memtable.TsFileProcessor;
import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResource;
import org.apache.iotdb.db.storageengine.dataregion.tsfile.timeindex.ArrayDeviceTimeIndex;
import org.apache.iotdb.db.utils.EnvironmentUtils;
@@ -89,9 +88,7 @@ public class LastFlushTimeMapTest {
dataRegion.insert(DataRegionTest.buildInsertRowNodeByTSRecord(record));
}
- for (TsFileProcessor tsfileProcessor : dataRegion.getWorkUnsequenceTsFileProcessors()) {
- tsfileProcessor.syncFlush();
- }
+ dataRegion.syncCloseWorkingTsFileProcessors(false);
Assert.assertEquals(
10000,
dataRegion
@@ -117,10 +114,6 @@ public class LastFlushTimeMapTest {
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(DataRegionTest.buildInsertRowNodeByTSRecord(record));
}
-
- for (TsFileProcessor tsfileProcessor : dataRegion.getWorkUnsequenceTsFileProcessors()) {
- tsfileProcessor.syncFlush();
- }
dataRegion.syncCloseAllWorkingTsFileProcessors();
Assert.assertEquals(
10000,
@@ -164,10 +157,6 @@ public class LastFlushTimeMapTest {
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(DataRegionTest.buildInsertRowNodeByTSRecord(record));
}
-
- for (TsFileProcessor tsfileProcessor : dataRegion.getWorkUnsequenceTsFileProcessors()) {
- tsfileProcessor.syncFlush();
- }
dataRegion.syncCloseAllWorkingTsFileProcessors();
Assert.assertEquals(
604_800_000,