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 2022/10/13 15:28:45 UTC

[iotdb] branch master updated: fix concurrent bug of creating new DataRegion in new_iotdb (#7596)

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 901976bcc8 fix concurrent bug of creating new DataRegion in new_iotdb (#7596)
901976bcc8 is described below

commit 901976bcc82ef33d4eff28cf38aca7e3f1ae05cf
Author: Haonan <hh...@outlook.com>
AuthorDate: Thu Oct 13 23:28:38 2022 +0800

    fix concurrent bug of creating new DataRegion in new_iotdb (#7596)
---
 .../org/apache/iotdb/db/localconfignode/LocalDataPartitionTable.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/localconfignode/LocalDataPartitionTable.java b/server/src/main/java/org/apache/iotdb/db/localconfignode/LocalDataPartitionTable.java
index d52afe32cf..7e0455207b 100644
--- a/server/src/main/java/org/apache/iotdb/db/localconfignode/LocalDataPartitionTable.java
+++ b/server/src/main/java/org/apache/iotdb/db/localconfignode/LocalDataPartitionTable.java
@@ -77,7 +77,7 @@ public class LocalDataPartitionTable {
     return Arrays.asList(regionIds);
   }
 
-  public DataRegionId getDataRegionWithAutoExtension(PartialPath path) {
+  public synchronized DataRegionId getDataRegionWithAutoExtension(PartialPath path) {
     int idx = Math.abs(path.hashCode() % regionNum);
     if (regionIds[idx] == null) {
       int nextId = DataRegionIdGenerator.getInstance().getNextId();