HxpSerein commented on code in PR #13148:
URL: https://github.com/apache/iotdb/pull/13148#discussion_r1716299054
##########
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensusServerImpl.java:
##########
@@ -619,6 +621,42 @@ public void waitTargetPeerUntilSyncLogCompleted(Peer
targetPeer)
}
}
+ public boolean hasReleaseAllRegionRelatedResource() {
+ return stateMachine.hasReleaseAllRegionRelatedResource();
+ }
+
+ public void waitReleaseAllRegionRelatedResource(Peer targetPeer)
+ throws ConsensusGroupModifyPeerException {
+ long checkIntervalInMs = 10_000L;
+ try (SyncIoTConsensusServiceClient client =
+ syncClientManager.borrowClient(targetPeer.getEndpoint())) {
+ while (true) {
+ TWaitReleaseAllRegionRelatedResourceRes res =
+ client.waitReleaseAllRegionRelatedResource(
+ new TWaitReleaseAllRegionRelatedResourceReq(
+ targetPeer.getGroupId().convertToTConsensusGroupId()));
+ if (res.allowRemovePeer) {
+ logger.info("[WAIT USER PIPE] {} allow remove peer.", targetPeer);
Review Comment:
fixed
##########
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensusServerImpl.java:
##########
@@ -619,6 +621,42 @@ public void waitTargetPeerUntilSyncLogCompleted(Peer
targetPeer)
}
}
+ public boolean hasReleaseAllRegionRelatedResource() {
+ return stateMachine.hasReleaseAllRegionRelatedResource();
+ }
+
+ public void waitReleaseAllRegionRelatedResource(Peer targetPeer)
+ throws ConsensusGroupModifyPeerException {
+ long checkIntervalInMs = 10_000L;
+ try (SyncIoTConsensusServiceClient client =
+ syncClientManager.borrowClient(targetPeer.getEndpoint())) {
+ while (true) {
+ TWaitReleaseAllRegionRelatedResourceRes res =
+ client.waitReleaseAllRegionRelatedResource(
+ new TWaitReleaseAllRegionRelatedResourceReq(
+ targetPeer.getGroupId().convertToTConsensusGroupId()));
+ if (res.allowRemovePeer) {
+ logger.info("[WAIT USER PIPE] {} allow remove peer.", targetPeer);
+ return;
+ }
+ logger.info("[WAIT USER PIPE] {} wait for permission to remove peer.",
targetPeer);
Review Comment:
fixed
--
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]