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

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


The following commit(s) were added to refs/heads/master by this push:
     new 8252ed8  revert fix fileNotException
8252ed8 is described below

commit 8252ed8a384503782b436f3ef29f83a4cff1c947
Author: chaow <[email protected]>
AuthorDate: Wed Dec 16 10:34:26 2020 +0800

    revert fix fileNotException
---
 .../main/java/org/apache/iotdb/db/metadata/logfile/MLogWriter.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/metadata/logfile/MLogWriter.java 
b/server/src/main/java/org/apache/iotdb/db/metadata/logfile/MLogWriter.java
index 79525ca..9fea132 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/logfile/MLogWriter.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/logfile/MLogWriter.java
@@ -252,9 +252,6 @@ public class MLogWriter implements AutoCloseable {
             logger.error("failed to upgrade cmd {}.", cmd, e);
           }
         }
-
-        // rename .bin.tmp to .bin
-        FSFactoryProducer.getFSFactory().moveFile(tmpLogFile, logFile);
       }
     } else if (!logFile.exists() && !tmpLogFile.exists()) {
       // if both .bin and .bin.tmp do not exist, nothing to do
@@ -287,6 +284,9 @@ public class MLogWriter implements AutoCloseable {
         throw new IOException(String.format(DELETE_FAILED_FORMAT, 
tmpOldLogFile, e.getMessage()));
       }
     }
+
+    // rename .bin.tmp to .bin
+    FSFactoryProducer.getFSFactory().moveFile(tmpLogFile, logFile);
   }
 
   public static void upgradeMLog() throws IOException {

Reply via email to