Vladsz83 commented on code in PR #12729:
URL: https://github.com/apache/ignite/pull/12729#discussion_r3246906065
##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java:
##########
@@ -3894,6 +3968,107 @@ else if (!failedNextNode && sndState != null &&
sndState.isBackward()) {
}
}
+ /** */
+ protected CrossRingMessageSendState
createConnectionRecoveryState(TcpDiscoveryNode newNextNode) {
+ CrossRingMessageSendState recoveryState = new
CrossRingMessageSendState();
+
+ // The corner node case. Next node is from neighbour DC. Another
DC might be entierly unavailable.
+ // To prevent sequential nodes failure in current DC we have to
guess whether we can reach neighbour DC.
+ // We ping nodes from another DC within the same timeout in
parallel.
+ if (!F.isEmpty(locNode.dataCenterId())) {
+ assert !F.isEmpty(next.dataCenterId());
+
+ if (!next.dataCenterId().equals(locNode.dataCenterId())) {
+ Stream<TcpDiscoveryNode> otherDcsSrvrs =
ring.serverNodes().stream()
+ .filter(n ->
!n.dataCenterId().equals(locNode.dataCenterId()));
+
+ synchronized (mux) {
+ otherDcsSrvrs = otherDcsSrvrs.filter(n ->
!failedNodes.containsKey(n));
+
+
recoveryState.pingRemoteDCs(otherDcsSrvrs.collect(toList()));
+ }
+ }
+ }
+
+ return recoveryState;
+ }
+
+ /** @return {@code True} if current node fails to recover the ring
connection. */
+ private boolean checkConnectionRecoveryFailed(
+ CrossRingMessageSendState connRecoverState,
+ List<TcpDiscoveryNode> failedNodes
+ ) {
+ if (connRecoverState.timeout()) {
+ // Ensure of the ping pool release.
+ connRecoverState.stopRemoteDcPing();
+
+ segmentLocalNodeOnSendFail(failedNodes);
+
+ return true;
+ }
+
+ if (!connRecoverState.remoteDcPingStarted() ||
!connRecoverState.remoteDcPingFinished()
+ || connRecoverState.unavailableDCs != null)
+ return false;
+
+ // Remote DC statuses: alive or not, Dc id -> true/false.
+ Collection<String> rmtDcIds =
connRecoverState.rmtDcPingRes.keySet().stream().map(ClusterNode::dataCenterId)
Review Comment:
It is not exposed, it is private. But is included into an internall class.
And is used only by a holding class. I don't thing we need any methods to
access internal-only classes. Also, _ConnectionRecoveryState_ becomes shorter
without extra methods while _ServerImpl_ is already quite large.
--
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]