From 7472af68961620b2385805de130dbbb1047bbf4b Mon Sep 17 00:00:00 2001 From: Nikolay Date: Tue, 10 Dec 2024 11:46:30 +0300 Subject: [PATCH] IGNITE-23844 Remove IgniteFeatures#MASTER_KEY_CHANGE and related code (#11702) --- .../org/apache/ignite/internal/IgniteFeatures.java | 9 --------- .../managers/encryption/GridEncryptionManager.java | 14 -------------- .../managers/encryption/GroupKeyChangeProcess.java | 5 ----- 3 files changed, 28 deletions(-) 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 45aee786eb6a7..aaa435538d678 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 @@ -18,12 +18,9 @@ package org.apache.ignite.internal; import java.util.BitSet; -import java.util.Collection; -import org.apache.ignite.IgniteEncryption; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi; -import org.apache.ignite.internal.managers.encryption.GridEncryptionManager; import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi; import org.apache.ignite.spi.communication.tcp.messages.HandshakeWaitMessage; import org.apache.ignite.spi.discovery.DiscoverySpi; @@ -59,9 +56,6 @@ public enum IgniteFeatures { /** Partition Map Exchange-free switch on baseline node left at fully rebalanced cluster. */ PME_FREE_SWITCH(19), - /** Master key change. See {@link GridEncryptionManager#changeMasterKey(String)}. */ - MASTER_KEY_CHANGE(20), - /** ContinuousQuery with security subject id support. */ CONT_QRY_SECURITY_AWARE(21), @@ -84,9 +78,6 @@ public enum IgniteFeatures { /** Compatibility support for new fields which are configured split. */ SPLITTED_CACHE_CONFIGURATIONS_V2(46), - /** Cache encryption key change. See {@link IgniteEncryption#changeCacheGroupKey(Collection)}. */ - CACHE_GROUP_KEY_CHANGE(47), - /** Collecting performance statistics. */ PERFORMANCE_STATISTICS(48), diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GridEncryptionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GridEncryptionManager.java index 3924c002b9f35..3cf84cafd170d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GridEncryptionManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GridEncryptionManager.java @@ -43,7 +43,6 @@ import org.apache.ignite.configuration.WALMode; import org.apache.ignite.failure.FailureContext; import org.apache.ignite.internal.GridKernalContext; -import org.apache.ignite.internal.IgniteFeatures; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.managers.GridManagerAdapter; import org.apache.ignite.internal.managers.communication.GridMessageListener; @@ -87,8 +86,6 @@ import static org.apache.ignite.failure.FailureType.CRITICAL_ERROR; import static org.apache.ignite.internal.GridComponent.DiscoveryDataExchangeType.ENCRYPTION_MGR; import static org.apache.ignite.internal.GridTopic.TOPIC_GEN_ENC_KEY; -import static org.apache.ignite.internal.IgniteFeatures.CACHE_GROUP_KEY_CHANGE; -import static org.apache.ignite.internal.IgniteFeatures.MASTER_KEY_CHANGE; import static org.apache.ignite.internal.managers.communication.GridIoPolicy.SYSTEM_POOL; import static org.apache.ignite.internal.util.distributed.DistributedProcess.DistributedProcessType.MASTER_KEY_CHANGE_FINISH; import static org.apache.ignite.internal.util.distributed.DistributedProcess.DistributedProcessType.MASTER_KEY_CHANGE_PREPARE; @@ -453,12 +450,6 @@ public void onLocalJoin() { "Master key digest differs! Node join is rejected."); } - if (!IgniteFeatures.nodeSupports(node, CACHE_GROUP_KEY_CHANGE)) { - return new IgniteNodeValidationResult(ctx.localNodeId(), - "Joining node doesn't support multiple encryption keys for single group [node=" + node.id() + "]", - "Joining node doesn't support multiple encryption keys for single group."); - } - if (F.isEmpty(nodeEncKeys.knownKeys)) { U.quietAndInfo(log, "Joining node doesn't have stored group keys [node=" + node.id() + "]"); @@ -672,11 +663,6 @@ void addGroupKey(int grpId, GroupKeyEncrypted key) { "perform this operation.")); } - if (!IgniteFeatures.allNodesSupports(ctx.grid().cluster().nodes(), MASTER_KEY_CHANGE)) { - return new IgniteFinishedFutureImpl<>(new IllegalStateException("Not all nodes in the cluster support " + - "the master key change process.")); - } - // WAL is unavailable for write on the inactive cluster. Master key change will not be logged and group keys // can be partially re-encrypted in case of node stop without the possibility of recovery. if (!ctx.state().clusterState().state().active()) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GroupKeyChangeProcess.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GroupKeyChangeProcess.java index 43503d014d2fd..415216d631a8d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GroupKeyChangeProcess.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GroupKeyChangeProcess.java @@ -24,7 +24,6 @@ import java.util.UUID; import org.apache.ignite.IgniteException; import org.apache.ignite.internal.GridKernalContext; -import org.apache.ignite.internal.IgniteFeatures; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.managers.encryption.GridEncryptionManager.EmptyResult; import org.apache.ignite.internal.managers.encryption.GridEncryptionManager.KeyChangeFuture; @@ -43,7 +42,6 @@ import org.apache.ignite.lang.IgniteFuture; import org.apache.ignite.lang.IgniteFutureCancelledException; -import static org.apache.ignite.internal.IgniteFeatures.CACHE_GROUP_KEY_CHANGE; import static org.apache.ignite.internal.util.distributed.DistributedProcess.DistributedProcessType.CACHE_GROUP_KEY_CHANGE_FINISH; import static org.apache.ignite.internal.util.distributed.DistributedProcess.DistributedProcessType.CACHE_GROUP_KEY_CHANGE_PREPARE; @@ -110,9 +108,6 @@ public IgniteFuture start(Collection cacheOrGrpNames) { if (ctx.clientNode()) throw new UnsupportedOperationException("Client nodes can not perform this operation."); - if (!IgniteFeatures.allNodesSupports(ctx.grid().cluster().nodes(), CACHE_GROUP_KEY_CHANGE)) - throw new IllegalStateException("Not all nodes in the cluster support this operation."); - if (!ctx.state().clusterState().state().active()) throw new IgniteException("Operation was rejected. The cluster is inactive.");