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 2023/01/13 10:29:03 UTC

[iotdb] branch master updated: fix data partition update error (#8840)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 993cf647fb fix data partition update error (#8840)
993cf647fb is described below

commit 993cf647fbefd3df084a4ad87414c9037a5c8c87
Author: Zhang.Jinrui <xi...@gmail.com>
AuthorDate: Fri Jan 13 18:28:55 2023 +0800

    fix data partition update error (#8840)
---
 .../org/apache/iotdb/db/mpp/plan/analyze/cache/PartitionCache.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/cache/PartitionCache.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/cache/PartitionCache.java
index ea23bc4fca..26e60f8782 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/cache/PartitionCache.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/cache/PartitionCache.java
@@ -749,9 +749,9 @@ public class PartitionCache {
         String storageGroupName = entry1.getKey();
         if (null != storageGroupName) {
           DataPartitionTable result = dataPartitionCache.getIfPresent(storageGroupName);
-          if (null == result) {
+          boolean needToUpdateCache = (null == result);
+          if (needToUpdateCache) {
             result = new DataPartitionTable();
-            dataPartitionCache.put(storageGroupName, result);
           }
           Map<TSeriesPartitionSlot, SeriesPartitionTable>
               seriesPartitionSlotSeriesPartitionTableMap = result.getDataPartitionMap();
@@ -775,6 +775,9 @@ public class PartitionCache {
               }
             }
           }
+          if (needToUpdateCache) {
+            dataPartitionCache.put(storageGroupName, result);
+          }
         }
       }
     } finally {