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 index 0bb9bf7bc39fb..788f55095274d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java @@ -34,9 +34,6 @@ public enum IgniteFeatures { /** Support of splitted cache configurations to avoid broken deserialization on non-affinity nodes. */ SPLITTED_CACHE_CONFIGURATIONS(5), - /** Distributed metastorage. */ - DISTRIBUTED_METASTORAGE(11), - /** Partition Map Exchange-free switch on baseline node left at fully rebalanced cluster. */ PME_FREE_SWITCH(19), diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/DistributedTransactionConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/DistributedTransactionConfiguration.java index d17205834dd6a..1433dfdacd1c0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/DistributedTransactionConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/DistributedTransactionConfiguration.java @@ -24,7 +24,6 @@ import org.apache.ignite.internal.processors.configuration.distributed.DistributedChangeableProperty; import org.apache.ignite.internal.processors.configuration.distributed.DistributedConfigurationLifecycleListener; import org.apache.ignite.internal.processors.configuration.distributed.DistributedPropertyDispatcher; -import org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage; import org.apache.ignite.internal.util.future.GridFutureAdapter; import static org.apache.ignite.IgniteSystemProperties.IGNITE_DUMP_TX_COLLISIONS_INTERVAL; @@ -160,44 +159,30 @@ public DistributedTransactionConfiguration( } @Override public void onReadyToWrite() { - if (ReadableDistributedMetaStorage.isSupported(ctx)) { - setDefaultValue( - longOperationsDumpTimeout, - dfltLongOpsDumpTimeout, - log); - setDefaultValue( - longTransactionTimeDumpThreshold, - dfltLongTransactionTimeDumpThreshold, - log); - setDefaultValue( - transactionTimeDumpSamplesCoefficient, - dfltTransactionTimeDumpSamplesCoefficient, - log); - setDefaultValue( - longTransactionTimeDumpSamplesPerSecondLimit, - dfltLongTransactionTimeDumpSamplesPerSecondLimit, - log); - setDefaultValue( - collisionsDumpInterval, - dfltCollisionsDumpInterval, - log); - setDefaultValue( - txOwnerDumpRequestsAllowed, - dfltTxOwnerDumpRequestsAllowed, - log); - } - else { - log.warning("Distributed metastorage is not supported. " + - "All distributed transaction configuration parameters are unavailable. " + - "Default values will be set."); - - longOperationsDumpTimeout.localUpdate(dfltLongOpsDumpTimeout); - longTransactionTimeDumpThreshold.localUpdate(dfltLongTransactionTimeDumpThreshold); - transactionTimeDumpSamplesCoefficient.localUpdate(dfltTransactionTimeDumpSamplesCoefficient); - longTransactionTimeDumpSamplesPerSecondLimit.localUpdate(dfltLongTransactionTimeDumpSamplesPerSecondLimit); - collisionsDumpInterval.localUpdate(dfltCollisionsDumpInterval); - txOwnerDumpRequestsAllowed.localUpdate(dfltTxOwnerDumpRequestsAllowed); - } + setDefaultValue( + longOperationsDumpTimeout, + dfltLongOpsDumpTimeout, + log); + setDefaultValue( + longTransactionTimeDumpThreshold, + dfltLongTransactionTimeDumpThreshold, + log); + setDefaultValue( + transactionTimeDumpSamplesCoefficient, + dfltTransactionTimeDumpSamplesCoefficient, + log); + setDefaultValue( + longTransactionTimeDumpSamplesPerSecondLimit, + dfltLongTransactionTimeDumpSamplesPerSecondLimit, + log); + setDefaultValue( + collisionsDumpInterval, + dfltCollisionsDumpInterval, + log); + setDefaultValue( + txOwnerDumpRequestsAllowed, + dfltTxOwnerDumpRequestsAllowed, + log); } } ); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/ReadableDistributedMetaStorage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/ReadableDistributedMetaStorage.java index 90abea6f16ee8..2c11a675c267d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/ReadableDistributedMetaStorage.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/ReadableDistributedMetaStorage.java @@ -18,42 +18,18 @@ package org.apache.ignite.internal.processors.metastorage; import java.io.Serializable; -import java.util.Collection; import java.util.function.BiConsumer; import java.util.function.Predicate; import org.apache.ignite.IgniteCheckedException; -import org.apache.ignite.cluster.ClusterNode; -import org.apache.ignite.internal.GridKernalContext; -import org.apache.ignite.internal.IgniteFeatures; -import org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi; -import org.apache.ignite.spi.discovery.DiscoverySpi; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import static org.apache.ignite.internal.IgniteFeatures.DISTRIBUTED_METASTORAGE; - /** * API for distributed data storage. Gives the ability to store configuration data (or any other data) * consistently and cluster-wide. It is guaranteed that every read value is the same on every node in the cluster * all the time. */ public interface ReadableDistributedMetaStorage { - /** - * @return {@code True} if all nodes in the cluster support discributed metastorage feature. - * @see IgniteFeatures#DISTRIBUTED_METASTORAGE - */ - public static boolean isSupported(GridKernalContext ctx) { - DiscoverySpi discoSpi = ctx.config().getDiscoverySpi(); - - if (discoSpi instanceof IgniteDiscoverySpi) - return ((IgniteDiscoverySpi)discoSpi).allNodesSupport(DISTRIBUTED_METASTORAGE); - else { - Collection nodes = discoSpi.getRemoteNodes(); - - return IgniteFeatures.allNodesSupports(nodes, DISTRIBUTED_METASTORAGE); - } - } - /** * Get the total number of updates (write/remove) that metastorage ever had. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/persistence/DistributedMetaStorageImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/persistence/DistributedMetaStorageImpl.java index afb5772609e9f..65952d22e405c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/persistence/DistributedMetaStorageImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/persistence/DistributedMetaStorageImpl.java @@ -62,7 +62,6 @@ import org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor; import org.apache.ignite.internal.util.IgniteUtils; import org.apache.ignite.internal.util.future.GridFutureAdapter; -import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteBiTuple; @@ -70,7 +69,6 @@ import org.apache.ignite.lang.IgniteProducer; import org.apache.ignite.marshaller.jdk.JdkMarshaller; import org.apache.ignite.spi.IgniteNodeValidationResult; -import org.apache.ignite.spi.IgniteSpiException; import org.apache.ignite.spi.discovery.DiscoveryDataBag; import org.apache.ignite.spi.discovery.DiscoveryDataBag.GridDiscoveryData; import org.apache.ignite.spi.discovery.DiscoveryDataBag.JoiningNodeDiscoveryData; @@ -83,7 +81,6 @@ import static org.apache.ignite.IgniteSystemProperties.IGNITE_GLOBAL_METASTORAGE_HISTORY_MAX_BYTES; import static org.apache.ignite.internal.GridComponent.DiscoveryDataExchangeType.META_STORAGE; import static org.apache.ignite.internal.processors.cache.GridCacheUtils.isPersistenceEnabled; -import static org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage.isSupported; import static org.apache.ignite.internal.processors.metastorage.persistence.DistributedMetaStorageHistoryItem.EMPTY_ARRAY; import static org.apache.ignite.internal.processors.metastorage.persistence.DistributedMetaStorageUtil.historyItemPrefix; import static org.apache.ignite.internal.processors.metastorage.persistence.DistributedMetaStorageUtil.historyItemVer; @@ -121,10 +118,6 @@ public class DistributedMetaStorageImpl extends GridProcessorAdapter /** Default upper bound of history size in bytes. */ public static final long DFLT_MAX_HISTORY_BYTES = 100 * 1024 * 1024; - /** Message indicating that clusted is in a mixed state and writing cannot be completed because of that. */ - public static final String NOT_SUPPORTED_MSG = "Ignite cluster has nodes that don't support" + - " distributed metastorage feature. Writing cannot be completed."; - /** Name of the system view for a system {@link MetaStorage}. */ public static final String DISTRIBUTED_METASTORE_VIEW = metricName("distributed", "metastorage"); @@ -642,19 +635,6 @@ private int getBaselineTopologyId() { try { DistributedMetaStorageVersion locVer = ver; - if (!discoData.hasJoiningNodeData()) { - // Joining node doesn't support distributed metastorage feature. - - if (isSupported(ctx) && locVer.id() > 0 && !node.isClient()) { - String errorMsg = "Node not supporting distributed metastorage feature" + - " is not allowed to join the cluster"; - - return new IgniteNodeValidationResult(node.id(), errorMsg); - } - else - return null; - } - DistributedMetaStorageJoiningNodeData joiningData = getJoiningNodeData(discoData); if (joiningData == null) { @@ -796,9 +776,6 @@ private String validatePayload(DistributedMetaStorageJoiningNodeData joiningData DistributedMetaStorageVersion remoteVer = joiningData.ver; - if (!isSupported(ctx) && remoteVer.id() > 0) - return; - lock.writeLock().lock(); try { @@ -850,9 +827,6 @@ private String validatePayload(DistributedMetaStorageJoiningNodeData joiningData if (!discoData.hasJoiningNodeData()) return; - if (!isSupported(ctx)) - return; - DistributedMetaStorageJoiningNodeData joiningData = getJoiningNodeData(discoData); if (joiningData == null) @@ -1071,7 +1045,7 @@ else if (!isClient && ver.id() > 0) { private GridFutureAdapter startWrite(String key, byte[] valBytes) throws IgniteCheckedException { UUID reqId = UUID.randomUUID(); - GridFutureAdapter fut = prepareWriteFuture(key, reqId); + GridFutureAdapter fut = prepareWriteFuture(reqId); if (fut.isDone()) return fut; @@ -1090,7 +1064,7 @@ private GridFutureAdapter startCas(String key, byte[] expValBytes, byte throws IgniteCheckedException { UUID reqId = UUID.randomUUID(); - GridFutureAdapter fut = prepareWriteFuture(key, reqId); + GridFutureAdapter fut = prepareWriteFuture(reqId); if (fut.isDone()) return fut; @@ -1113,27 +1087,7 @@ private GridFutureAdapter startCas(String key, byte[] expValBytes, byte * @return Future that must be returned immediately or {@code null}. * @throws IgniteCheckedException If cluster can't perform this update. */ - private GridFutureAdapter prepareWriteFuture(String key, UUID reqId) throws IgniteCheckedException { - boolean supported; - - try { - supported = isSupported(ctx); - } - catch (Exception e) { - if (X.hasCause(e, IgniteSpiException.class) && e.getMessage() != null && e.getMessage().contains("Node stopped.")) { - GridFutureAdapter fut = new GridFutureAdapter<>(); - - fut.onDone(nodeStoppingException()); - - return fut; - } - - throw e; - } - - if (!supported) - throw new IgniteCheckedException(NOT_SUPPORTED_MSG); - + private GridFutureAdapter prepareWriteFuture(UUID reqId) { GridFutureAdapter fut = new GridFutureAdapter<>(); updateFutsStopLock.readLock().lock(); @@ -1170,12 +1124,6 @@ private void onUpdateMessage( if (msg.errorMessage() != null) return; - if (!isSupported(ctx)) { - msg.errorMessage(NOT_SUPPORTED_MSG); - - return; - } - lock.writeLock().lock(); try { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/DistributedSqlConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/DistributedSqlConfiguration.java index 050c9686960af..79367e1522cbb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/DistributedSqlConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/DistributedSqlConfiguration.java @@ -24,7 +24,6 @@ import org.apache.ignite.internal.processors.configuration.distributed.DistributedConfigurationLifecycleListener; import org.apache.ignite.internal.processors.configuration.distributed.DistributedPropertyDispatcher; import org.apache.ignite.internal.processors.configuration.distributed.SimpleDistributedProperty; -import org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage; import org.apache.ignite.internal.util.future.GridFutureAdapter; import org.apache.ignite.internal.util.typedef.internal.A; @@ -80,19 +79,10 @@ protected DistributedSqlConfiguration( @SuppressWarnings("deprecation") @Override public void onReadyToWrite() { - if (ReadableDistributedMetaStorage.isSupported(ctx)) { - setDefaultValue( - dfltQryTimeout, - (int)ctx.config().getSqlConfiguration().getDefaultQueryTimeout(), - log); - } - else { - log.warning("Distributed metastorage is not supported. " + - "All distributed SQL configuration parameters are unavailable."); - - // Set properties to default. - dfltQryTimeout.localUpdate((int)ctx.config().getSqlConfiguration().getDefaultQueryTimeout()); - } + setDefaultValue( + dfltQryTimeout, + (int)ctx.config().getSqlConfiguration().getDefaultQueryTimeout(), + log); } } ); diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DistributedIndexingConfiguration.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DistributedIndexingConfiguration.java index 1b51ca947be14..06fbdc8d0ab80 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DistributedIndexingConfiguration.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DistributedIndexingConfiguration.java @@ -29,7 +29,6 @@ import org.apache.ignite.internal.processors.configuration.distributed.DistributedConfigurationLifecycleListener; import org.apache.ignite.internal.processors.configuration.distributed.DistributedPropertyDispatcher; import org.apache.ignite.internal.processors.configuration.distributed.SimpleDistributedProperty; -import org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage; import org.apache.ignite.internal.processors.query.DistributedSqlConfiguration; import org.apache.ignite.internal.util.future.GridFutureAdapter; @@ -89,25 +88,15 @@ public DistributedIndexingConfiguration( } @Override public void onReadyToWrite() { - if (ReadableDistributedMetaStorage.isSupported(ctx)) { - setDefaultValue( - disabledSqlFuncs, - DFLT_DISABLED_FUNCS, - log); - - setDefaultValue( - disableCreateLuceneIndexForStringValueType, - false, - log); - } - else { - log.warning("Distributed metastorage is not supported. " + - "All distributed SQL configuration parameters are unavailable."); - - // Set properties to default. - disabledSqlFuncs.localUpdate(null); - disableCreateLuceneIndexForStringValueType.localUpdate(false); - } + setDefaultValue( + disabledSqlFuncs, + DFLT_DISABLED_FUNCS, + log); + + setDefaultValue( + disableCreateLuceneIndexForStringValueType, + false, + log); } } );