Skip to content

Commit

Permalink
IGNITE-23855 Remove IgniteFeatures#PME_FREE_SWITCH and related code (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
nizhikov authored Dec 17, 2024
1 parent 9bb8811 commit 08ebc23
Show file tree
Hide file tree
Showing 17 changed files with 8 additions and 349 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,6 @@ public final class IgniteSystemProperties {
type = Long.class, defaults = "" + DFLT_EXCHANGE_MERGE_DELAY)
public static final String IGNITE_EXCHANGE_MERGE_DELAY = "IGNITE_EXCHANGE_MERGE_DELAY";

/** PME-free switch explicitly disabled. */
@SystemProperty("Disables PME-free switch")
public static final String IGNITE_PME_FREE_SWITCH_DISABLED = "IGNITE_PME_FREE_SWITCH_DISABLED";

/**
* Name of the system property defining name of command line program.
*/
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_DATA_STREAMER_POOL_SIZE;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_DEPLOYMENT_MODE;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_DYNAMIC_CACHE_START_ROLLBACK_SUPPORTED;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_IGNITE_FEATURES;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_IGNITE_INSTANCE_NAME;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_IPS;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_JIT_NAME;
Expand Down Expand Up @@ -1734,9 +1733,6 @@ private void fillNodeAttributes(boolean notifyEnabled) throws IgniteCheckedExcep
add(ATTR_TX_SERIALIZABLE_ENABLED, cfg.getTransactionConfiguration().isTxSerializableEnabled());
add(ATTR_TX_AWARE_QUERIES_ENABLED, cfg.getTransactionConfiguration().isTxAwareQueriesEnabled());

// Supported features.
add(ATTR_IGNITE_FEATURES, IgniteFeatures.allFeatures());

// Stick in SPI versions and classes attributes.
addSpiAttributes(cfg.getCollisionSpi());
addSpiAttributes(cfg.getDiscoverySpi());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import java.util.UUID;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.IgniteFeatures;
import org.apache.ignite.spi.discovery.DiscoverySpi;

/**
Expand All @@ -43,12 +42,6 @@ public interface IgniteDiscoverySpi extends DiscoverySpi {
*/
public void clientReconnect();

/**
* @param feature Feature to check.
* @return {@code true} if all nodes support the given feature.
*/
public boolean allNodesSupport(IgniteFeatures feature);

/**
* For TESTING only.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import org.jetbrains.annotations.Nullable;

import static org.apache.ignite.IgniteSystemProperties.getBoolean;
import static org.apache.ignite.internal.IgniteFeatures.PME_FREE_SWITCH;
import static org.apache.ignite.internal.IgniteFeatures.allNodesSupports;
import static org.apache.ignite.internal.events.DiscoveryCustomEvent.EVT_DISCOVERY_CUSTOM_EVT;
import static org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager.exchangeProtocolVersion;
import static org.apache.ignite.internal.processors.cache.persistence.snapshot.IgniteSnapshotManager.isSnapshotOperation;
Expand Down Expand Up @@ -85,17 +83,10 @@ public ExchangeContext(GridCacheSharedContext<?, ?> cctx, boolean crd, GridDhtPa

int protocolVer = exchangeProtocolVersion(fut.firstEventCache().minimumNodeVersion());

boolean allNodesSupportsPmeFreeSwitch = allNodesSupports(fut.firstEventCache().allNodes(), PME_FREE_SWITCH);

if (!allNodesSupportsPmeFreeSwitch)
log.warning("Current topology does not support the PME-free switch. Please check all nodes support" +
" this feature and it was not explicitly disabled by IGNITE_PME_FREE_SWITCH_DISABLED JVM option.");

boolean pmeFreeAvailable = (fut.wasRebalanced() && fut.isBaselineNodeFailed()) || isSnapshotOperation(fut.firstEvent());

if (!compatibilityNode &&
pmeFreeAvailable &&
allNodesSupportsPmeFreeSwitch) {
pmeFreeAvailable) {
exchangeFreeSwitch = true;
merge = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@

import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_BINARY_CONFIGURATION;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_CACHE;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_IGNITE_FEATURES;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_NODE_CONSISTENT_ID;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_REST_TCP_ADDRS;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_REST_TCP_HOST_NAMES;
Expand Down Expand Up @@ -310,7 +309,7 @@ private GridClientNodeBean createNodeBean(ClusterNode node, boolean mtr, boolean
if (e.getValue() != null) {
if (e.getValue().getClass().isEnum() || e.getValue() instanceof InetAddress)
e.setValue(e.getValue().toString());
else if (e.getValue().getClass().isArray() && !ATTR_IGNITE_FEATURES.equals(e.getKey()))
else if (e.getValue().getClass().isArray())
i.remove();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteFeatures;
import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi;
import org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpiInternalListener;
Expand All @@ -54,7 +53,6 @@
import static java.util.Collections.emptyList;
import static java.util.Collections.singleton;
import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
import static org.apache.ignite.internal.IgniteFeatures.allNodesSupports;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS;
import static org.apache.ignite.internal.events.DiscoveryCustomEvent.EVT_DISCOVERY_CUSTOM_EVT;
import static org.apache.ignite.internal.processors.security.SecurityUtils.authenticateLocalNode;
Expand Down Expand Up @@ -265,14 +263,6 @@ public class IsolatedDiscoverySpi extends IgniteSpiAdapter implements IgniteDisc
super.injectResources(ignite);
}

/** {@inheritDoc} */
@Override public boolean allNodesSupport(IgniteFeatures feature) {
if (locNode == null)
return false;

return allNodesSupports(singleton(locNode), feature);
}

/** {@inheritDoc} */
@Override public void simulateNodeFailure() {
// No-op.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
import org.apache.ignite.failure.FailureContext;
import org.apache.ignite.internal.IgniteClientDisconnectedCheckedException;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteFeatures;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.IgniteNodeAttributes;
import org.apache.ignite.internal.managers.discovery.CustomMessageWrapper;
Expand Down Expand Up @@ -384,11 +383,6 @@ class ClientImpl extends TcpDiscoveryImpl {
return U.arrayList(rmtNodes.values(), TcpDiscoveryNodesRing.VISIBLE_NODES);
}

/** {@inheritDoc} */
@Override public boolean allNodesSupport(IgniteFeatures feature) {
return IgniteFeatures.allNodesSupports(upcast(rmtNodes.values()), feature);
}

/** {@inheritDoc} */
@Nullable @Override public ClusterNode getNode(UUID nodeId) {
if (getLocalNodeId().equals(nodeId))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
import org.apache.ignite.events.NodeValidationFailedEvent;
import org.apache.ignite.failure.FailureContext;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteFeatures;
import org.apache.ignite.internal.IgniteFutureTimeoutCheckedException;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.IgniteNodeAttributes;
Expand Down Expand Up @@ -364,12 +363,6 @@ class ServerImpl extends TcpDiscoveryImpl {
return upcast(ring.visibleRemoteNodes());
}

/** {@inheritDoc} */
@Override public boolean allNodesSupport(IgniteFeatures feature) {
// It is ok to see visible node without order here because attributes are available when node is created.
return IgniteFeatures.allNodesSupports(upcast(ring.allNodes()), feature);
}

/** {@inheritDoc} */
@Override public int boundPort() throws IgniteSpiException {
if (tcpSrvr == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.apache.ignite.cluster.ClusterMetrics;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteFeatures;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.processors.tracing.NoopTracing;
import org.apache.ignite.internal.processors.tracing.Tracing;
Expand Down Expand Up @@ -250,12 +249,6 @@ protected void onMessageExchanged() {
*/
public abstract Collection<ClusterNode> getRemoteNodes();

/**
* @param feature Feature to check.
* @return {@code true} if all nodes support the given feature, {@code false} otherwise.
*/
public abstract boolean allNodesSupport(IgniteFeatures feature);

/**
* @param nodeId Node id.
* @return Node with given ID or {@code null} if node is not found.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.failure.FailureContext;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteFeatures;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi;
import org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpiInternalListener;
Expand Down Expand Up @@ -2448,14 +2447,6 @@ boolean isSslEnabled() {
impl.reconnect();
}

/** {@inheritDoc} */
@Override public boolean allNodesSupport(IgniteFeatures feature) {
if (impl == null)
return false;

return impl.allNodesSupport(feature);
}

/** {@inheritDoc} */
@Override public boolean knownNode(UUID nodeId) {
return getNode0(nodeId) != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ org.apache.ignite.internal.IgniteDiagnosticPrepareContext$1
org.apache.ignite.internal.IgniteDiagnosticPrepareContext$CompoundInfoClosure
org.apache.ignite.internal.IgniteEventsImpl
org.apache.ignite.internal.IgniteEventsImpl$1
org.apache.ignite.internal.IgniteFeatures
org.apache.ignite.internal.IgniteFutureCancelledCheckedException
org.apache.ignite.internal.IgniteFutureTimeoutCheckedException
org.apache.ignite.internal.IgniteInterruptedCheckedException
Expand Down
Loading

0 comments on commit 08ebc23

Please sign in to comment.