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 2022/10/13 15:05:36 UTC

[iotdb] 01/01: fix concurrent bug of creating new DataRegion in new_iotdb

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

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

commit 853e326f805a135856acfa8ca792b9ed0527bb18
Author: HTHou <hh...@outlook.com>
AuthorDate: Thu Oct 13 23:05:16 2022 +0800

    fix concurrent bug of creating new DataRegion in new_iotdb
---
 .../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();