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 2021/01/07 04:13:59 UTC

[iotdb] branch rel/0.11 updated: Some RestartTests failed because the compaction module does not allow clear the MManamger before it is stopped

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

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


The following commit(s) were added to refs/heads/rel/0.11 by this push:
     new 2cd8385  Some RestartTests failed because the compaction module does not allow clear the MManamger before it is stopped
2cd8385 is described below

commit 2cd838515b744838aed07fab1fdf5a55e7651ebb
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Thu Jan 7 11:20:36 2021 +0800

    Some RestartTests failed because the compaction module does not allow clear the MManamger before it is stopped
---
 server/src/main/java/org/apache/iotdb/db/service/IoTDB.java    | 10 +++++++++-
 .../test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java  |  3 ++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/service/IoTDB.java b/server/src/main/java/org/apache/iotdb/db/service/IoTDB.java
index dc05c1b..80dfda8 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/IoTDB.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/IoTDB.java
@@ -163,14 +163,22 @@ public class IoTDB implements IoTDBMBean {
 
   }
 
+  /**
+   * stop IoTDB's daemon service.
+   */
   @Override
   public void stop() {
     deactivate();
   }
 
+  /**
+   * stop accept new requests.
+   * @throws Exception
+   */
   public void shutdown() throws Exception {
     logger.info("Deactivating IoTDB...");
-    IoTDB.metaManager.clear();
+    //we can not clear the metadata manager before the compaction process really stops.
+    //IoTDB.metaManager.clear();
     TracingManager.getInstance().close();
     registerManager.shutdownAll();
     PrimitiveArrayManager.close();
diff --git a/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java b/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
index 00db06a..bc2866a 100644
--- a/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
+++ b/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
@@ -255,7 +255,7 @@ public class EnvironmentUtils {
     }
   }
 
-  public static void shutdownDaemon() throws Exception {
+  private static void shutdownDaemon() throws Exception {
     if (daemon != null) {
       daemon.shutdown();
     }
@@ -279,6 +279,7 @@ public class EnvironmentUtils {
   public static void restartDaemon() throws Exception {
     shutdownDaemon();
     stopDaemon();
+    IoTDB.metaManager.clear();
     reactiveDaemon();
   }