You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ne...@apache.org on 2021/09/09 07:59:27 UTC

[iotdb] branch rel/0.12 updated: [IOTDB-1619] There is an error msg when I restart iotdb-cluster (#3930) (#3933)

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

neuyilan pushed a commit to branch rel/0.12
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/0.12 by this push:
     new 47666a0  [IOTDB-1619] There is an error msg when I restart iotdb-cluster (#3930) (#3933)
47666a0 is described below

commit 47666a06ac3a332e1df2214f7363975a0f6c7273
Author: lisijia <44...@users.noreply.github.com>
AuthorDate: Thu Sep 9 15:58:58 2021 +0800

    [IOTDB-1619] There is an error msg when I restart iotdb-cluster (#3930) (#3933)
---
 .../cluster/log/manage/serializable/SyncLogDequeSerializer.java  | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/serializable/SyncLogDequeSerializer.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/serializable/SyncLogDequeSerializer.java
index c81e6d0..87f2c8b 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/serializable/SyncLogDequeSerializer.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/serializable/SyncLogDequeSerializer.java
@@ -450,11 +450,6 @@ public class SyncLogDequeSerializer implements StableEntryManager {
     this.firstLogIndex = meta.getCommitLogIndex() + 1;
     try {
       recoverLogFiles();
-
-      logDataFileList.sort(this::comparePersistLogFileName);
-
-      logIndexFileList.sort(this::comparePersistLogFileName);
-
       // add init log file
       if (logDataFileList.isEmpty()) {
         createNewLogFile(metaFile.getParentFile().getPath(), meta.getCommitLogIndex() + 1);
@@ -473,6 +468,10 @@ public class SyncLogDequeSerializer implements StableEntryManager {
     // 2. recover the log data file
     recoverLogFiles(LOG_DATA_FILE_SUFFIX);
 
+    // sort by name before recover
+    logDataFileList.sort(this::comparePersistLogFileName);
+    logIndexFileList.sort(this::comparePersistLogFileName);
+
     // 3. recover the last log file in case of abnormal exit
     recoverTheLastLogFile();
   }