You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2019/11/20 09:00:37 UTC

[incubator-iotdb] branch rel/0.9 updated: merge bugfix 264 skip bad wal (#573)

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

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


The following commit(s) were added to refs/heads/rel/0.9 by this push:
     new 16c0ea2  merge bugfix 264 skip bad wal (#573)
16c0ea2 is described below

commit 16c0ea284b75638575389fdb202d4c9a171f0293
Author: Xiangdong Huang <hx...@qq.com>
AuthorDate: Wed Nov 20 16:58:06 2019 +0800

    merge bugfix 264 skip bad wal (#573)
    
    (cherry picked from commit 92f68441a190cd45c61e4f94b79e8e79b31ccbfc)
---
 .../org/apache/iotdb/db/writelog/recover/LogReplayer.java    | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/writelog/recover/LogReplayer.java b/server/src/main/java/org/apache/iotdb/db/writelog/recover/LogReplayer.java
index 26a7703..46751b9 100644
--- a/server/src/main/java/org/apache/iotdb/db/writelog/recover/LogReplayer.java
+++ b/server/src/main/java/org/apache/iotdb/db/writelog/recover/LogReplayer.java
@@ -43,13 +43,15 @@ import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.fileSystem.FSFactoryProducer;
 import org.apache.iotdb.tsfile.read.common.Path;
 import org.apache.iotdb.tsfile.write.schema.Schema;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * LogReplayer finds the logNode of the TsFile given by insertFilePath and logNodePrefix, reads the
  * WALs from the logNode and redoes them into a given MemTable and ModificationFile.
  */
 public class LogReplayer {
-
+  Logger logger = LoggerFactory.getLogger(LogReplayer.class);
   private String logNodePrefix;
   private String insertFilePath;
   private ModificationFile modFile;
@@ -170,7 +172,13 @@ public class LogReplayer {
       dataTypes[i] = schema.getMeasurementDataType(measurementList[i]);
     }
     insertPlan.setDataTypes(dataTypes);
-    recoverMemTable.insert(insertPlan);
+    try {
+      recoverMemTable.insert(insertPlan);
+    } catch (Exception e) {
+      logger.error(
+          "occurs exception when replaying the record {} at timestamp {}: {}.(Will ignore the record)",
+          insertPlan.getPaths(), insertPlan.getTime(), e.getMessage());
+    }
   }
 
   @SuppressWarnings("unused")