MarcosZyk commented on code in PR #11736:
URL: https://github.com/apache/iotdb/pull/11736#discussion_r1429445385


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/CachedMTreeStore.java:
##########
@@ -553,69 +609,40 @@ public CachedSchemaRegionStatistics getRegionStatistics() 
{
    * @return should not continue releasing
    */
   public boolean executeMemoryRelease() {
-    if (regionStatistics.getUnpinnedMemorySize() != 0) {
-      return !cacheManager.evict();
-    } else {
-      return true;
+    lockManager.globalReadUnlock();
+    try {
+      if (regionStatistics.getUnpinnedMemorySize() != 0) {
+        return !cacheManager.evict();
+      } else {
+        return true;
+      }
+    } finally {
+      lockManager.globalReadUnlock();
     }
   }
 
   /** Sync all volatile nodes to PBTree and execute memory release after 
flush. */
-  public void flushVolatileNodes() {
+  public void flushVolatileNodes(boolean needLock) {
+    if (needLock) {
+      lockManager.globalReadLock();
+    }

Review Comment:
   Seems duplicate with the global lock taking in PBTreeFlushExecutor



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to