This is an automated email from the ASF dual-hosted git repository.
CRZbulabula pushed a commit to branch dev/1.3
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/dev/1.3 by this push:
new a6643abc42d Fix RegionGroupCache activation race (#18128) (#18136)
a6643abc42d is described below
commit a6643abc42da7a21a77fe2228f513ca03c8487d4
Author: Caideyipi <[email protected]>
AuthorDate: Tue Jul 7 14:37:35 2026 +0800
Fix RegionGroupCache activation race (#18128) (#18136)
---
.../confignode/manager/load/cache/region/RegionGroupCache.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/region/RegionGroupCache.java
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/region/RegionGroupCache.java
index 0ee3f7d2cf8..f95c8effe47 100644
---
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/region/RegionGroupCache.java
+++
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/region/RegionGroupCache.java
@@ -61,7 +61,7 @@ public class RegionGroupCache {
* @param newHeartbeatSample The newest RegionHeartbeatSample
* @param overwrite Able to overwrite Adding or Removing
*/
- public void cacheHeartbeatSample(
+ public synchronized void cacheHeartbeatSample(
int dataNodeId, RegionHeartbeatSample newHeartbeatSample, boolean
overwrite) {
// Only cache sample when the corresponding loadCache exists
Optional.ofNullable(regionCacheMap.get(dataNodeId))
@@ -78,7 +78,7 @@ public class RegionGroupCache {
*
* @param dataNodeId the specified DataNode
*/
- public void createRegionCache(int dataNodeId) {
+ public synchronized void createRegionCache(int dataNodeId) {
regionCacheMap.put(dataNodeId, new RegionCache());
}
@@ -87,7 +87,7 @@ public class RegionGroupCache {
*
* @param dataNodeId the specified DataNode
*/
- public void removeRegionCache(int dataNodeId) {
+ public synchronized void removeRegionCache(int dataNodeId) {
regionCacheMap.remove(dataNodeId);
}
@@ -95,7 +95,7 @@ public class RegionGroupCache {
* Update currentStatistics based on the latest NodeHeartbeatSamples that
cached in the
* slidingWindow.
*/
- public void updateCurrentStatistics() {
+ public synchronized void updateCurrentStatistics() {
regionCacheMap.values().forEach(regionCache ->
regionCache.updateCurrentStatistics(false));
Map<Integer, RegionStatistics> regionStatisticsMap =
regionCacheMap.entrySet().stream()