iotdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qiaojia...@apache.org
Subject [incubator-iotdb] branch master updated: fix unclosed broken file (#223)
Date Mon, 08 Jul 2019 06:25:39 GMT
This is an automated email from the ASF dual-hosted git repository.

qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 77da29b  fix unclosed broken file (#223)
77da29b is described below

commit 77da29b7812d850bb067335b71968423e8fe1ffb
Author: Jiang Tian <jt2594838@163.com>
AuthorDate: Mon Jul 8 14:25:35 2019 +0800

    fix unclosed broken file (#223)
---
 .../writelog/recover/TsFileRecoverPerformer.java   | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/iotdb/src/main/java/org/apache/iotdb/db/writelog/recover/TsFileRecoverPerformer.java
b/iotdb/src/main/java/org/apache/iotdb/db/writelog/recover/TsFileRecoverPerformer.java
index 0afc926..dcf850e 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/writelog/recover/TsFileRecoverPerformer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/recover/TsFileRecoverPerformer.java
@@ -112,20 +112,20 @@ public class TsFileRecoverPerformer {
 
     // redo logs
     logReplayer.replayLogs();
-    if (!recoverMemTable.isEmpty()) {
-      // flush logs
-      MemTableFlushTask tableFlushTask = new MemTableFlushTask(recoverMemTable, fileSchema,
-          restorableTsFileIOWriter,
-          logNodePrefix);
-      try {
+    try {
+      if (!recoverMemTable.isEmpty()) {
+        // flush logs
+        MemTableFlushTask tableFlushTask = new MemTableFlushTask(recoverMemTable, fileSchema,
+            restorableTsFileIOWriter,
+            logNodePrefix);
         tableFlushTask.syncFlushMemTable();
-        // close file
-        restorableTsFileIOWriter.endFile(fileSchema);
-        tsFileResource.serialize();
-      } catch (ExecutionException | InterruptedException | IOException e) {
-        Thread.currentThread().interrupt();
-        throw new ProcessorException(e);
       }
+      // close file
+      restorableTsFileIOWriter.endFile(fileSchema);
+      tsFileResource.serialize();
+    } catch (ExecutionException | InterruptedException | IOException e) {
+      Thread.currentThread().interrupt();
+      throw new ProcessorException(e);
     }
 
     // clean logs


Mime
View raw message