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 2023/03/01 10:23:38 UTC

[iotdb] branch remove_tsfile_after_flush created (now 0914a2a084)

This is an automated email from the ASF dual-hosted git repository.

haonan pushed a change to branch remove_tsfile_after_flush
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at 0914a2a084 remove_tsfile_after_flush

This branch includes the following new commits:

     new 0914a2a084 remove_tsfile_after_flush

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/01: remove_tsfile_after_flush

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch remove_tsfile_after_flush
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 0914a2a0846f6d9fa2b40758754925cf61dce36e
Author: HTHou <hh...@outlook.com>
AuthorDate: Wed Mar 1 18:22:01 2023 +0800

    remove_tsfile_after_flush
---
 .../iotdb/db/engine/storagegroup/DataRegion.java       | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
index 7f2a19a410..fcb431d0ef 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
@@ -2112,17 +2112,13 @@ public class DataRegion implements IDataRegionForQuery {
     closeQueryLock.writeLock().lock();
     try {
       tsFileProcessor.close();
-      if (tsFileProcessor.isEmpty()) {
-        try {
-          fsFactory.deleteIfExists(tsFileProcessor.getTsFileResource().getTsFile());
-          tsFileManager.remove(tsFileProcessor.getTsFileResource(), tsFileProcessor.isSequence());
-        } catch (IOException e) {
-          logger.error(
-              "Remove empty file {} error",
-              tsFileProcessor.getTsFileResource().getTsFile().getAbsolutePath());
-        }
-      } else {
-        tsFileResourceManager.registerSealedTsFileResource(tsFileProcessor.getTsFileResource());
+      try {
+        fsFactory.deleteIfExists(tsFileProcessor.getTsFileResource().getTsFile());
+        tsFileManager.remove(tsFileProcessor.getTsFileResource(), tsFileProcessor.isSequence());
+      } catch (IOException e) {
+        logger.error(
+            "Remove empty file {} error",
+            tsFileProcessor.getTsFileResource().getTsFile().getAbsolutePath());
       }
     } finally {
       closeQueryLock.writeLock().unlock();