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

[incubator-iotdb] branch fix-264-2-bad-wal created (now 5c1a413)

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

hxd pushed a change to branch fix-264-2-bad-wal
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.


      at 5c1a413  merge bugfix 264 skip bad wal

This branch includes the following new commits:

     new 5c1a413  merge bugfix 264 skip bad wal

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.



[incubator-iotdb] 01/01: merge bugfix 264 skip bad wal

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

hxd pushed a commit to branch fix-264-2-bad-wal
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit 5c1a413c2c9999a75d49152ea02d381ecde34a9b
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Wed Nov 20 15:32:49 2019 +0800

    merge bugfix 264 skip bad wal
---
 .../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")