Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-24098 Remove ExchangeLatchManager#SIZES_VALIDATION_AVAILABLE_SINCE #11806

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1640,8 +1640,7 @@ private void distributedExchange() throws IgniteCheckedException {
timeBag.finishGlobalStage("Preloading notification");

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

if (context().exchangeFreeSwitch() && isBaselineNodeFailed())
waitPartitionRelease(null, false, false);
Expand Down Expand Up @@ -1998,10 +1997,6 @@ private void waitPartitionRelease(

releaseLatch.countDown();

// For compatibility with old version where joining nodes are not waiting for latch.
if (localJoinExchange() && !cctx.exchange().latch().canSkipJoiningNodes(initialVersion()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this clause was always false (canSkipJoiningNodes always return true).
So in PR you can remove it completely

return;

try {
String troubleshootingHint;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ public class ExchangeLatchManager {
/** Version since latch management is available. */
private static final IgniteProductVersion VERSION_SINCE = IgniteProductVersion.fromString("2.5.0");

/**
* Exchange latch V2 protocol introduces following optimization: Joining nodes are explicitly excluded from possible
* latch participants.
*/
public static final IgniteProductVersion PROTOCOL_V2_VERSION_SINCE = IgniteProductVersion.fromString("2.5.3");

/** Logger. */
private final IgniteLogger log;

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

if (canSkipJoiningNodes(topVer))
return excludeJoinedNodes(participantNodes, topVer);

return participantNodes;
return excludeJoinedNodes(participantNodes, topVer);
}

/**
Expand Down Expand Up @@ -342,23 +333,7 @@ private List<ClusterNode> excludeJoinedNodes(List<ClusterNode> participantNodes,
if (applicableNodes.isEmpty())
return null;

if (canSkipJoiningNodes(topVer))
applicableNodes = excludeJoinedNodes(applicableNodes, topVer);

return applicableNodes.get(0);
}

/**
* Checks that latch manager can use V2 protocol and skip joining nodes from latch participants.
*
* @param topVer Topology version.
* @throws IgniteException If nodes for the given {@code topVer} cannot be found in the discovery history.
*/
public boolean canSkipJoiningNodes(AffinityTopologyVersion topVer) {
Collection<ClusterNode> applicableNodes = aliveNodesForTopologyVer(topVer);

return applicableNodes.stream()
.allMatch(node -> node.version().compareTo(PROTOCOL_V2_VERSION_SINCE) >= 0);
return excludeJoinedNodes(applicableNodes, topVer).get(0);
}

/**
Expand Down