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

[iotdb] branch fix_sg_not_ready_log created (now b457054)

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

qiaojialin pushed a change to branch fix_sg_not_ready_log
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


      at b457054  fix sg may not ready log

This branch includes the following new commits:

     new b457054  fix sg may not ready log

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.


[iotdb] 01/01: fix sg may not ready log

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

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

commit b457054e6d5e9803cf6df2c6ff5e9eac76c6c669
Author: qiaojialin <64...@qq.com>
AuthorDate: Wed Jul 7 18:41:32 2021 +0800

    fix sg may not ready log
---
 .../main/java/org/apache/iotdb/db/engine/StorageEngine.java   | 11 +++++------
 .../storagegroup/virtualSg/VirtualStorageGroupManager.java    |  4 +++-
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
index 4727b7f..5d6b067 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
@@ -395,13 +395,13 @@ public class StorageEngine implements IService {
   /**
    * This method is for insert and query or sth like them, this may get a virtual storage group
    *
-   * @param path device path
+   * @param deviceId device path
    * @return storage group processor
    */
-  public StorageGroupProcessor getProcessor(PartialPath path) throws StorageEngineException {
+  public StorageGroupProcessor getProcessor(PartialPath deviceId) throws StorageEngineException {
     try {
-      StorageGroupMNode storageGroupMNode = IoTDB.metaManager.getStorageGroupNodeByPath(path);
-      return getStorageGroupProcessorByPath(path, storageGroupMNode);
+      StorageGroupMNode storageGroupMNode = IoTDB.metaManager.getStorageGroupNodeByPath(deviceId);
+      return getStorageGroupProcessorByPath(deviceId, storageGroupMNode);
     } catch (StorageGroupProcessorException | MetadataException e) {
       throw new StorageEngineException(e);
     }
@@ -445,8 +445,7 @@ public class StorageEngine implements IService {
     if (virtualStorageGroupManager == null) {
       // if finish recover
       if (isAllSgReady.get()) {
-        waitAllSgReady(devicePath);
-        synchronized (storageGroupMNode) {
+        synchronized (this) {
           virtualStorageGroupManager = processorMap.get(storageGroupMNode.getPartialPath());
           if (virtualStorageGroupManager == null) {
             virtualStorageGroupManager = new VirtualStorageGroupManager();
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/virtualSg/VirtualStorageGroupManager.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/virtualSg/VirtualStorageGroupManager.java
index 135048d..996b857 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/virtualSg/VirtualStorageGroupManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/virtualSg/VirtualStorageGroupManager.java
@@ -115,7 +115,9 @@ public class VirtualStorageGroupManager {
       } else {
         // not finished recover, refuse the request
         throw new StorageEngineException(
-            "the sg " + partialPath + " may not ready now, please wait and retry later",
+            "the sg "
+                + storageGroupMNode.getFullPath()
+                + " may not ready now, please wait and retry later",
             TSStatusCode.STORAGE_GROUP_NOT_READY.getStatusCode());
       }
     }