Skip to content

Commit 28744b4

Browse files
committed
IGNITE-24098 Removed ExchangeLatchManager#SIZES_VALIDATION_AVAILABLE_SINCE
1 parent 8ee63d7 commit 28744b4

File tree

2 files changed

+3
-33
lines changed

2 files changed

+3
-33
lines changed

modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -1640,8 +1640,7 @@ private void distributedExchange() throws IgniteCheckedException {
16401640
timeBag.finishGlobalStage("Preloading notification");
16411641

16421642
// Skipping wait on local join is available when all cluster nodes have the same protocol.
1643-
boolean skipWaitOnLocJoin = localJoinExchange()
1644-
&& cctx.exchange().latch().canSkipJoiningNodes(initialVersion());
1643+
boolean skipWaitOnLocJoin = localJoinExchange();
16451644

16461645
if (context().exchangeFreeSwitch() && isBaselineNodeFailed())
16471646
waitPartitionRelease(null, false, false);
@@ -1998,10 +1997,6 @@ private void waitPartitionRelease(
19981997

19991998
releaseLatch.countDown();
20001999

2001-
// For compatibility with old version where joining nodes are not waiting for latch.
2002-
if (localJoinExchange() && !cctx.exchange().latch().canSkipJoiningNodes(initialVersion()))
2003-
return;
2004-
20052000
try {
20062001
String troubleshootingHint;
20072002

modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java

+2-27
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ public class ExchangeLatchManager {
6161
/** Version since latch management is available. */
6262
private static final IgniteProductVersion VERSION_SINCE = IgniteProductVersion.fromString("2.5.0");
6363

64-
/**
65-
* Exchange latch V2 protocol introduces following optimization: Joining nodes are explicitly excluded from possible
66-
* latch participants.
67-
*/
68-
public static final IgniteProductVersion PROTOCOL_V2_VERSION_SINCE = IgniteProductVersion.fromString("2.5.3");
69-
7064
/** Logger. */
7165
private final IgniteLogger log;
7266

@@ -305,10 +299,7 @@ private Collection<ClusterNode> getLatchParticipants(AffinityTopologyVersion top
305299
.filter(node -> node.version().compareTo(VERSION_SINCE) >= 0)
306300
.collect(Collectors.toList());
307301

308-
if (canSkipJoiningNodes(topVer))
309-
return excludeJoinedNodes(participantNodes, topVer);
310-
311-
return participantNodes;
302+
return excludeJoinedNodes(participantNodes, topVer);
312303
}
313304

314305
/**
@@ -342,23 +333,7 @@ private List<ClusterNode> excludeJoinedNodes(List<ClusterNode> participantNodes,
342333
if (applicableNodes.isEmpty())
343334
return null;
344335

345-
if (canSkipJoiningNodes(topVer))
346-
applicableNodes = excludeJoinedNodes(applicableNodes, topVer);
347-
348-
return applicableNodes.get(0);
349-
}
350-
351-
/**
352-
* Checks that latch manager can use V2 protocol and skip joining nodes from latch participants.
353-
*
354-
* @param topVer Topology version.
355-
* @throws IgniteException If nodes for the given {@code topVer} cannot be found in the discovery history.
356-
*/
357-
public boolean canSkipJoiningNodes(AffinityTopologyVersion topVer) {
358-
Collection<ClusterNode> applicableNodes = aliveNodesForTopologyVer(topVer);
359-
360-
return applicableNodes.stream()
361-
.allMatch(node -> node.version().compareTo(PROTOCOL_V2_VERSION_SINCE) >= 0);
336+
return excludeJoinedNodes(applicableNodes, topVer).get(0);
362337
}
363338

364339
/**

0 commit comments

Comments
 (0)