Skip to content

Commit

Permalink
IGNITE-23844 Remove IgniteFeatures#MASTER_KEY_CHANGE and related code (
Browse files Browse the repository at this point in the history
  • Loading branch information
nizhikov authored Dec 10, 2024
1 parent fe02946 commit 7472af6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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),

Expand All @@ -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),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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() + "]");

Expand Down Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -110,9 +108,6 @@ public IgniteFuture<Void> start(Collection<String> 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.");

Expand Down

0 comments on commit 7472af6

Please sign in to comment.