This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a commit to branch rel/1.2
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/1.2 by this push:
new 5af83fac1b5 Optimize leader change event (#10797) (#10804)
5af83fac1b5 is described below
commit 5af83fac1b5db9b8bb4643580b7fd1fcb3988ee3
Author: Potato <[email protected]>
AuthorDate: Mon Aug 7 17:04:03 2023 +0800
Optimize leader change event (#10797) (#10804)
Co-authored-by: YongzaoDan <[email protected]>
---
.../iotdb/confignode/manager/load/service/StatisticsService.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/StatisticsService.java
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/StatisticsService.java
index 01f8fab8934..feb01ee04ef 100644
---
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/StatisticsService.java
+++
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/StatisticsService.java
@@ -147,7 +147,9 @@ public class StatisticsService implements
IClusterStatusSubscriber {
// Map<RegionGroupId, Pair<old priority, new priority>>
Map<TConsensusGroupId, Pair<TRegionReplicaSet, TRegionReplicaSet>>
differentRegionPriorityMap = routeBalancer.balanceRegionPriority();
- eventBus.post(new RouteChangeEvent(differentRegionLeaderMap,
differentRegionPriorityMap));
+ if (!differentRegionLeaderMap.isEmpty() ||
!differentRegionPriorityMap.isEmpty()) {
+ eventBus.post(new RouteChangeEvent(differentRegionLeaderMap,
differentRegionPriorityMap));
+ }
}
if (isNeedBroadcast) {