You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ni...@apache.org on 2024/12/17 09:43:38 UTC
(ignite) branch master updated: IGNITE-23855 Remove IgniteFeatures#PME_FREE_SWITCH and related code (#11706)
This is an automated email from the ASF dual-hosted git repository.
nizhikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new 08ebc23f4eb2 IGNITE-23855 Remove IgniteFeatures#PME_FREE_SWITCH and related code (#11706)
08ebc23f4eb2 is described below
commit 08ebc23f4eb2fa29001b900fd9a501747c2f7ddd
Author: Nikolay <ni...@apache.org>
AuthorDate: Tue Dec 17 12:43:31 2024 +0300
IGNITE-23855 Remove IgniteFeatures#PME_FREE_SWITCH and related code (#11706)
---
.../org/apache/ignite/IgniteSystemProperties.java | 4 -
.../org/apache/ignite/internal/IgniteFeatures.java | 147 ---------------------
.../org/apache/ignite/internal/IgniteKernal.java | 4 -
.../managers/discovery/IgniteDiscoverySpi.java | 7 -
.../internal/processors/cache/ExchangeContext.java | 11 +-
.../handlers/top/GridTopologyCommandHandler.java | 3 +-
.../discovery/isolated/IsolatedDiscoverySpi.java | 10 --
.../ignite/spi/discovery/tcp/ClientImpl.java | 6 -
.../ignite/spi/discovery/tcp/ServerImpl.java | 7 -
.../ignite/spi/discovery/tcp/TcpDiscoveryImpl.java | 7 -
.../ignite/spi/discovery/tcp/TcpDiscoverySpi.java | 9 --
.../main/resources/META-INF/classnames.properties | 1 -
.../distributed/GridExchangeFreeSwitchTest.java | 111 +---------------
...municationSpiSkipWaitHandshakeOnClientTest.java | 4 +-
.../discovery/DiscoverySpiDataExchangeTest.java | 6 -
.../spi/discovery/zk/ZookeeperDiscoverySpi.java | 9 --
.../zk/internal/ZookeeperDiscoveryImpl.java | 11 --
17 files changed, 8 insertions(+), 349 deletions(-)
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
index ae4263392c87..0f643fbb4752 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -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.
*/
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java
deleted file mode 100644
index 799d60ecd2fc..000000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal;
-
-import java.util.BitSet;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi;
-import org.apache.ignite.spi.discovery.DiscoverySpi;
-
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_PME_FREE_SWITCH_DISABLED;
-import static org.apache.ignite.IgniteSystemProperties.getBoolean;
-import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_IGNITE_FEATURES;
-
-/**
- * Defines supported features and check its on other nodes.
- */
-public enum IgniteFeatures {
- /** Partition Map Exchange-free switch on baseline node left at fully rebalanced cluster. */
- PME_FREE_SWITCH(19);
-
- /**
- * Unique feature identifier.
- */
- private final int featureId;
-
- /**
- * @param featureId Feature ID.
- */
- IgniteFeatures(int featureId) {
- this.featureId = featureId;
- }
-
- /**
- * @return Feature ID.
- */
- public int getFeatureId() {
- return featureId;
- }
-
- /**
- * Checks that feature supported by node.
- *
- * @param clusterNode Cluster node to check.
- * @param feature Feature to check.
- * @return {@code True} if feature is declared to be supported by remote node.
- */
- public static boolean nodeSupports(ClusterNode clusterNode, IgniteFeatures feature) {
- final byte[] features = clusterNode.attribute(ATTR_IGNITE_FEATURES);
-
- if (features == null)
- return false;
-
- return nodeSupports(features, feature);
- }
-
- /**
- * Checks that feature supported by node.
- *
- * @param featuresAttrBytes Byte array value of supported features node attribute.
- * @param feature Feature to check.
- * @return {@code True} if feature is declared to be supported by remote node.
- */
- public static boolean nodeSupports(byte[] featuresAttrBytes, IgniteFeatures feature) {
- int featureId = feature.getFeatureId();
-
- // Same as "BitSet.valueOf(features).get(featureId)"
-
- int byteIdx = featureId >>> 3;
-
- if (byteIdx >= featuresAttrBytes.length)
- return false;
-
- int bitIdx = featureId & 0x7;
-
- return (featuresAttrBytes[byteIdx] & (1 << bitIdx)) != 0;
- }
-
- /**
- * Checks that feature supported by all nodes.
- *
- * @param nodes cluster nodes to check their feature support.
- * @return if feature is declared to be supported by all nodes
- */
- public static boolean allNodesSupports(Iterable<ClusterNode> nodes, IgniteFeatures feature) {
- for (ClusterNode next : nodes) {
- if (!nodeSupports(next, feature))
- return false;
- }
-
- return true;
- }
-
- /**
- * Check that feature is supported by all remote nodes.
- *
- * @param discoSpi Discovery SPI implementation.
- * @param feature Feature to check.
- * @return {@code True} if all remote nodes support the feature.
- */
- public static boolean allNodesSupport(
- DiscoverySpi discoSpi,
- IgniteFeatures feature
- ) {
- if (discoSpi instanceof IgniteDiscoverySpi)
- return ((IgniteDiscoverySpi)discoSpi).allNodesSupport(feature);
- else
- return allNodesSupports(discoSpi.getRemoteNodes(), feature);
- }
-
- /**
- * Features supported by the current node.
- *
- * @return Byte array representing all supported features by current node.
- */
- public static byte[] allFeatures() {
- final BitSet set = new BitSet();
-
- for (IgniteFeatures val : IgniteFeatures.values()) {
- if (val == PME_FREE_SWITCH && getBoolean(IGNITE_PME_FREE_SWITCH_DISABLED))
- continue;
-
- final int featureId = val.getFeatureId();
-
- assert !set.get(featureId) : "Duplicate feature ID found for [" + val + "] having same ID ["
- + featureId + "]";
-
- set.set(featureId);
- }
-
- return set.toByteArray();
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 1e1e8fb5212f..4361c97edef2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -241,7 +241,6 @@ import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_DATA_STORAGE_
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;
@@ -1734,9 +1733,6 @@ public class IgniteKernal implements IgniteEx, Externalizable {
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());
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/IgniteDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/IgniteDiscoverySpi.java
index f2f825040ce4..9aa5d140bbab 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/IgniteDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/IgniteDiscoverySpi.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.managers.discovery;
import java.util.UUID;
import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.IgniteFeatures;
import org.apache.ignite.spi.discovery.DiscoverySpi;
/**
@@ -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.
*/
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeContext.java
index 4e2197e319d1..7c345c245d80 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeContext.java
@@ -29,8 +29,6 @@ import org.apache.ignite.internal.util.typedef.internal.S;
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;
@@ -85,17 +83,10 @@ public class ExchangeContext {
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;
}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
index 3323e0b07ec0..8350e3e6ad17 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
@@ -52,7 +52,6 @@ import org.apache.ignite.spi.IgnitePortProtocol;
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;
@@ -310,7 +309,7 @@ public class GridTopologyCommandHandler extends GridRestCommandHandlerAdapter {
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();
}
}
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedDiscoverySpi.java
index 0fead5170cfe..0890729dfdc9 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedDiscoverySpi.java
@@ -29,7 +29,6 @@ import org.apache.ignite.IgniteException;
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;
@@ -54,7 +53,6 @@ import org.jetbrains.annotations.Nullable;
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;
@@ -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.
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
index a7e1ad4a7831..2c6b2e2e044c 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
@@ -65,7 +65,6 @@ import org.apache.ignite.configuration.IgniteConfiguration;
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;
@@ -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))
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index d9af3c810dfe..3359095e8b13 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -75,7 +75,6 @@ import org.apache.ignite.cluster.ClusterNode;
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;
@@ -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)
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
index 0c7cad56e520..93a4be878278 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
@@ -34,7 +34,6 @@ import org.apache.ignite.cache.CacheMetrics;
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;
@@ -250,12 +249,6 @@ abstract class TcpDiscoveryImpl {
*/
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.
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 335fc62d848d..abffb63f9ec0 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -57,7 +57,6 @@ import org.apache.ignite.configuration.AddressResolver;
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;
@@ -2448,14 +2447,6 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements IgniteDiscovery
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;
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index 9d5bf1f18ce3..945f4fc60d53 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -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
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridExchangeFreeSwitchTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridExchangeFreeSwitchTest.java
index efaadd7c98bf..4120a21829e0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridExchangeFreeSwitchTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridExchangeFreeSwitchTest.java
@@ -55,11 +55,7 @@ import org.apache.ignite.transactions.Transaction;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_PME_FREE_SWITCH_DISABLED;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
-import static org.apache.ignite.internal.IgniteFeatures.PME_FREE_SWITCH;
-import static org.apache.ignite.internal.IgniteFeatures.allNodesSupports;
-import static org.apache.ignite.internal.IgniteFeatures.nodeSupports;
import static org.apache.ignite.testframework.GridTestUtils.runAsync;
/**
@@ -142,7 +138,7 @@ public class GridExchangeFreeSwitchTest extends GridCommonAbstractTest {
*/
@Test
public void testNonBaselineNodeLeftOnFullyRebalancedCluster() throws Exception {
- testNodeLeftOnFullyRebalancedCluster(PmeFreeSwitchDisabledNode.NONE);
+ testNodeLeftOnFullyRebalancedCluster();
}
/**
@@ -150,103 +146,23 @@ public class GridExchangeFreeSwitchTest extends GridCommonAbstractTest {
*/
@Test
public void testBaselineNodeLeftOnFullyRebalancedCluster() throws Exception {
- testBaselineNodeLeftOnFullyRebalancedCluster(PmeFreeSwitchDisabledNode.NONE);
- }
-
- /**
- * Checks PME is absent/present with all nodes except first one supports PME-free switch.
- */
- @Test
- public void testBaselineNodeLeftOnFullyRebalancedClusterPmeFreeDisabledFirstNode() throws Exception {
- testBaselineNodeLeftOnFullyRebalancedCluster(PmeFreeSwitchDisabledNode.FIRST);
- }
-
- /**
- * Checks PME is absent/present with all nodes except midlle one supports PME-free switch.
- */
- @Test
- public void testBaselineNodeLeftOnFullyRebalancedClusterPmeFreeDisabledMiddleNode() throws Exception {
- testBaselineNodeLeftOnFullyRebalancedCluster(PmeFreeSwitchDisabledNode.MIDDLE);
- }
-
- /**
- * Checks PME is absent/present with all nodes except last one supports PME-free switch.
- */
- @Test
- public void testBaselineNodeLeftOnFullyRebalancedClusterPmeFreeDisabledLastNode() throws Exception {
- testBaselineNodeLeftOnFullyRebalancedCluster(PmeFreeSwitchDisabledNode.LAST);
- }
-
- /**
- * Checks PME is absent/present in case of persistence enabled.
- */
- private void testBaselineNodeLeftOnFullyRebalancedCluster(PmeFreeSwitchDisabledNode order) throws Exception {
persistence = true;
try {
- testNodeLeftOnFullyRebalancedCluster(order);
+ testNodeLeftOnFullyRebalancedCluster();
}
finally {
persistence = false;
}
}
- /**
- * Starts node with PME-free feature explicitly disabled.
- */
- private void startNodeWithPmeFreeSwitchDisabled() throws Exception {
- try {
- System.setProperty(IGNITE_PME_FREE_SWITCH_DISABLED, "true");
-
- Ignite ignite = startGrid(G.allGrids().size());
-
- assertFalse(nodeSupports(ignite.cluster().localNode(), PME_FREE_SWITCH));
- }
- finally {
- System.clearProperty(IGNITE_PME_FREE_SWITCH_DISABLED);
- }
- }
-
/**
* Checks node left PME absent/present on fully rebalanced topology (Latest PME == LAA).
*/
- private void testNodeLeftOnFullyRebalancedCluster(PmeFreeSwitchDisabledNode disabled) throws Exception {
+ private void testNodeLeftOnFullyRebalancedCluster() throws Exception {
int nodes = 10;
- switch (disabled) {
- case FIRST:
- startNodeWithPmeFreeSwitchDisabled();
-
- startGridsMultiThreaded(1, nodes - 1);
-
- break;
-
- case MIDDLE:
- startGridsMultiThreaded(0, (nodes / 2) - 1);
-
- startNodeWithPmeFreeSwitchDisabled();
-
- int started = G.allGrids().size();
-
- startGridsMultiThreaded(started, nodes - started);
-
- break;
-
- case LAST:
- startGridsMultiThreaded(0, nodes - 1);
-
- startNodeWithPmeFreeSwitchDisabled();
-
- break;
-
- case NONE:
- startGridsMultiThreaded(0, nodes);
-
- break;
-
- default:
- throw new UnsupportedOperationException();
- }
+ startGridsMultiThreaded(0, nodes);
assertEquals(nodes, G.allGrids().size());
@@ -272,7 +188,7 @@ public class GridExchangeFreeSwitchTest extends GridCommonAbstractTest {
assertTrue(alive.context().cache().context().exchange().lastFinishedFuture().rebalanced());
- boolean pmeFreeSwitch = persistence && allNodesSupports(alive.cluster().nodes(), PME_FREE_SWITCH);
+ boolean pmeFreeSwitch = persistence;
assertEquals(pmeFreeSwitch ? 0 : (nodes - 1), singleCnt.get());
assertEquals(pmeFreeSwitch ? 0 : (nodes - 1), fullCnt.get());
@@ -775,21 +691,4 @@ public class GridExchangeFreeSwitchTest extends GridCommonAbstractTest {
return res;
}
}
-
- /**
- * Specifies node to start with IGNITE_PME_FREE_SWITCH_DISABLED JVM option.
- */
- private enum PmeFreeSwitchDisabledNode {
- /** First. */
- FIRST,
-
- /** Middle. */
- MIDDLE,
-
- /** Last. */
- LAST,
-
- /** None. */
- NONE
- }
}
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiSkipWaitHandshakeOnClientTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiSkipWaitHandshakeOnClientTest.java
index 5175f2f3eb68..41e925a8093b 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiSkipWaitHandshakeOnClientTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiSkipWaitHandshakeOnClientTest.java
@@ -20,7 +20,6 @@ package org.apache.ignite.spi.communication.tcp;
import java.io.InputStream;
import java.net.Socket;
import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteFeatures;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.ListeningTestLogger;
@@ -34,8 +33,7 @@ import static org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.NODE_I
import static org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.makeMessageType;
/**
- * This test check that client sends only Node ID message type on connect. There is a gap when {@link
- * IgniteFeatures#allNodesSupports} isn't consistent, because the list of nodes is empty.
+ * This test check that client sends only Node ID message type on connect.
*/
public class GridTcpCommunicationSpiSkipWaitHandshakeOnClientTest extends GridCommonAbstractTest {
/** Tcp communication start message. */
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchangeTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchangeTest.java
index 44eef02ef913..6b7e213c54df 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchangeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchangeTest.java
@@ -29,7 +29,6 @@ import org.apache.ignite.IgniteException;
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.managers.discovery.IgniteDiscoverySpi;
import org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpiInternalListener;
import org.apache.ignite.internal.util.typedef.T2;
@@ -213,11 +212,6 @@ public class DiscoverySpiDataExchangeTest extends GridCommonAbstractTest {
delegate.clientReconnect();
}
- /** {@inheritDoc} */
- @Override public boolean allNodesSupport(IgniteFeatures feature) {
- return delegate.allNodesSupport(feature);
- }
-
/** {@inheritDoc} */
@Override public void simulateNodeFailure() {
delegate.simulateNodeFailure();
diff --git a/modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/ZookeeperDiscoverySpi.java b/modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/ZookeeperDiscoverySpi.java
index 48e765a2bbb3..d7a6e75e7a77 100644
--- a/modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/ZookeeperDiscoverySpi.java
+++ b/modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/ZookeeperDiscoverySpi.java
@@ -29,7 +29,6 @@ import java.util.UUID;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.IgniteFeatures;
import org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi;
import org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpiInternalListener;
import org.apache.ignite.internal.processors.metric.MetricRegistryImpl;
@@ -341,14 +340,6 @@ public class ZookeeperDiscoverySpi extends IgniteSpiAdapter implements IgniteDis
return impl.remoteNodes();
}
- /** {@inheritDoc} */
- @Override public boolean allNodesSupport(IgniteFeatures feature) {
- if (impl == null)
- return false;
-
- return impl.allNodesSupport(feature);
- }
-
/** {@inheritDoc} */
@Override public ClusterNode getLocalNode() {
return impl != null ? impl.localNode() : null;
diff --git a/modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java b/modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java
index f1b5fda348af..174cb2629d84 100644
--- a/modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java
+++ b/modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java
@@ -56,7 +56,6 @@ import org.apache.ignite.configuration.CommunicationFailureResolver;
import org.apache.ignite.events.EventType;
import org.apache.ignite.events.NodeValidationFailedEvent;
import org.apache.ignite.internal.IgniteClientDisconnectedCheckedException;
-import org.apache.ignite.internal.IgniteFeatures;
import org.apache.ignite.internal.IgniteFutureTimeoutCheckedException;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteKernal;
@@ -603,16 +602,6 @@ public class ZookeeperDiscoveryImpl {
return rtState.top.remoteNodes();
}
- /**
- * @param feature Feature to check.
- * @return {@code true} if all nodes support the given feature, {@code false} otherwise.
- */
- public boolean allNodesSupport(IgniteFeatures feature) {
- checkState();
-
- return rtState != null && rtState.top.isAllNodes(n -> IgniteFeatures.nodeSupports(n, feature));
- }
-
/**
*
*/