You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by su...@apache.org on 2020/07/02 09:23:42 UTC

[incubator-iotdb] branch fix_create_mtree updated (b27cac8 -> b7926fb)

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

sunzesong pushed a change to branch fix_create_mtree
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.


 discard b27cac8  Fix logic of creating MTree snapshot
     new b7926fb  Fix logic of creating MTree snapshot

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (b27cac8)
            \
             N -- N -- N   refs/heads/fix_create_mtree (b7926fb)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 .../org/apache/iotdb/db/metadata/MManager.java     | 108 ++++++++++-----------
 1 file changed, 51 insertions(+), 57 deletions(-)


[incubator-iotdb] 01/01: Fix logic of creating MTree snapshot

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

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

commit b7926fb539a9c0098aa4b9ff3328264e30b27da6
Author: samperson1997 <sz...@mails.tsinghua.edu.cn>
AuthorDate: Thu Jul 2 17:23:27 2020 +0800

    Fix logic of creating MTree snapshot
---
 .../main/java/org/apache/iotdb/db/metadata/MManager.java | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/MManager.java b/server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
index 57eb238..c6caffa 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
@@ -1785,27 +1785,25 @@ public class MManager {
       // the logWriter is not initialized now, we skip the check once.
       return;
     }
-    if (System.currentTimeMillis() - logFile.lastModified() >= mtreeSnapshotThresholdTime
-        && logWriter.getLineNumber() > 0) {
-      logger.info("Start creating MTree snapshot, because {} ms elapse.",
+    if (System.currentTimeMillis() - logFile.lastModified() < mtreeSnapshotThresholdTime) {
+      logger.info("MTree snapshot need not be created. Time from last modification: {} ms.",
           System.currentTimeMillis() - logFile.lastModified());
-      createMTreeSnapshot();
-    } else if (logWriter.getLineNumber() >= mtreeSnapshotInterval) {
-      logger.info("Start creating MTree snapshot, because of {} new lines are added.",
+    } else if (logWriter.getLineNumber() < mtreeSnapshotInterval) {
+      logger.info("MTree snapshot need not be created. New mlog line number: {}.",
           logWriter.getLineNumber());
-      createMTreeSnapshot();
     } else {
       if (logger.isDebugEnabled()) {
-        logger.debug(
-            "MTree snapshot need not be created. New mlog line number: {}, time difference from last modification: {} ms",
+        logger.debug("New mlog line number: {}, time from last modification: {} ms",
             logWriter.getLineNumber(), System.currentTimeMillis() - logFile.lastModified());
       }
+      createMTreeSnapshot();
     }
   }
 
   public void createMTreeSnapshot() {
     lock.readLock().lock();
     long time = System.currentTimeMillis();
+    logger.info("Start creating MTree snapshot to {}", mtreeSnapshotPath);
     try {
       mtree.serializeTo(mtreeSnapshotTmpPath);
       File tmpFile = SystemFileFactory.INSTANCE.getFile(mtreeSnapshotTmpPath);