You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2021/09/17 10:16:47 UTC

[iotdb] branch rel/0.12 updated: [To rel/0.12][IOTDB-1703] Fix MManager slow recover with tag (#3996)

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

haonan 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 1d523c5  [To rel/0.12][IOTDB-1703] Fix MManager slow recover with tag (#3996)
1d523c5 is described below

commit 1d523c5c91ae5596e741531387f04b85b112a016
Author: zyk990424 <38...@users.noreply.github.com>
AuthorDate: Fri Sep 17 18:16:12 2021 +0800

    [To rel/0.12][IOTDB-1703] Fix MManager slow recover with tag (#3996)
---
 RELEASE_NOTES.md                                          |  1 +
 .../main/java/org/apache/iotdb/db/metadata/MManager.java  | 15 +++++++--------
 .../java/org/apache/iotdb/db/metadata/mnode/MNode.java    |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index a853ab7..734720c 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -36,6 +36,7 @@
 * [IOTDB-1678] Fix client-cpp session bug: can cause connection leak.
 * [IOTDB-1679] client-cpp: Session descontruction need release server resource
 * [IOTDB-1690] Fix align by device type cast error
+* [IOTDB-1703] Fix MManager slow recover with tag  
 * [ISSUE-3945] Fix Fuzzy query not support multiDevices and alignByDevice Dataset
 * fix IoTDB restart does not truncate broken ChunkGroup bug
 * fix merge ClassCastException: MeasurementMNode
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 704cc37..191ab9e 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
@@ -102,7 +102,6 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArraySet;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
@@ -440,7 +439,7 @@ public class MManager {
           }
           tagIndex
               .computeIfAbsent(entry.getKey(), k -> new ConcurrentHashMap<>())
-              .computeIfAbsent(entry.getValue(), v -> new CopyOnWriteArraySet<>())
+              .computeIfAbsent(entry.getValue(), v -> Collections.synchronizedSet(new HashSet<>()))
               .add(leafMNode);
         }
       }
@@ -1275,7 +1274,7 @@ public class MManager {
         for (Entry<String, String> entry : tagsMap.entrySet()) {
           tagIndex
               .computeIfAbsent(entry.getKey(), k -> new ConcurrentHashMap<>())
-              .computeIfAbsent(entry.getValue(), v -> new CopyOnWriteArraySet<>())
+              .computeIfAbsent(entry.getValue(), v -> Collections.synchronizedSet(new HashSet<>()))
               .add(leafMNode);
         }
       }
@@ -1328,7 +1327,7 @@ public class MManager {
         if (beforeValue == null || !beforeValue.equals(value)) {
           tagIndex
               .computeIfAbsent(key, k -> new ConcurrentHashMap<>())
-              .computeIfAbsent(value, v -> new CopyOnWriteArraySet<>())
+              .computeIfAbsent(value, v -> Collections.synchronizedSet(new HashSet<>()))
               .add(leafMNode);
         }
       }
@@ -1402,7 +1401,7 @@ public class MManager {
       for (Entry<String, String> entry : tagsMap.entrySet()) {
         tagIndex
             .computeIfAbsent(entry.getKey(), k -> new ConcurrentHashMap<>())
-            .computeIfAbsent(entry.getValue(), v -> new CopyOnWriteArraySet<>())
+            .computeIfAbsent(entry.getValue(), v -> Collections.synchronizedSet(new HashSet<>()))
             .add(leafMNode);
       }
       return;
@@ -1429,7 +1428,7 @@ public class MManager {
         (key, value) ->
             tagIndex
                 .computeIfAbsent(key, k -> new ConcurrentHashMap<>())
-                .computeIfAbsent(value, v -> new CopyOnWriteArraySet<>())
+                .computeIfAbsent(value, v -> Collections.synchronizedSet(new HashSet<>()))
                 .add(leafMNode));
   }
 
@@ -1589,7 +1588,7 @@ public class MManager {
       }
       tagIndex
           .computeIfAbsent(key, k -> new ConcurrentHashMap<>())
-          .computeIfAbsent(currentValue, k -> new CopyOnWriteArraySet<>())
+          .computeIfAbsent(currentValue, k -> Collections.synchronizedSet(new HashSet<>()))
           .add(leafMNode);
     }
   }
@@ -1660,7 +1659,7 @@ public class MManager {
       }
       tagIndex
           .computeIfAbsent(newKey, k -> new ConcurrentHashMap<>())
-          .computeIfAbsent(value, k -> new CopyOnWriteArraySet<>())
+          .computeIfAbsent(value, k -> Collections.synchronizedSet(new HashSet<>()))
           .add(leafMNode);
     } else if (pair.right.containsKey(oldKey)) {
       // check attribute map
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/mnode/MNode.java b/server/src/main/java/org/apache/iotdb/db/metadata/mnode/MNode.java
index d74dd9c..c35c8ed 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/mnode/MNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/mnode/MNode.java
@@ -352,7 +352,7 @@ public class MNode implements Serializable {
     if (fullPath == null) {
       return Objects.equals(getFullPath(), mNode.getFullPath());
     } else {
-      return Objects.equals(fullPath, mNode.fullPath);
+      return Objects.equals(fullPath, mNode.getFullPath());
     }
   }