OneSizeFitsQuorum commented on code in PR #14910:
URL: https://github.com/apache/iotdb/pull/14910#discussion_r1964634025
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/RouteBalancer.java:
##########
@@ -283,9 +298,46 @@ private void invalidateSchemaCacheOfOldLeaders(
.sendAsyncRequest(invalidateSchemaCacheRequestHandler);
}
+ private void flushOldLeaderIfIoTV2() {
+ if (!IS_ENABLE_AUTO_LEADER_BALANCE_FOR_DATA_REGION
+ || !Objects.equals(
+ DATA_REGION_CONSENSUS_PROTOCOL_CLASS,
ConsensusFactory.IOT_CONSENSUS_V2)) {
+ return;
+ }
+
+ BiConsumer<Integer, TConsensusGroupId> consumer =
+ (oldLeaderId, regionGroupId) -> {
+ TDataNodeConfiguration configuration =
+ getNodeManager().getRegisteredDataNode(oldLeaderId);
+ Map<Integer, TDataNodeLocation> oldLeaderDataNodeLocation = new
HashMap<>();
+ oldLeaderDataNodeLocation.put(
+ configuration.getLocation().dataNodeId,
configuration.getLocation());
+
+ TFlushReq flushReq = new TFlushReq();
+
flushReq.setRegionIds(Collections.singletonList(String.valueOf(regionGroupId.getId())));
+ // Do our best to flush. If flush failed, never retry
+ TSStatus result = configManager.flushOnSpecificDN(flushReq,
oldLeaderDataNodeLocation);
Review Comment:
merge all flush request for one node?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]