Skip to content

Commit

Permalink
IGNITE-23846 Remove IgniteFeatures#PERSISTENCE_CACHE_SNAPSHOT and rel…
Browse files Browse the repository at this point in the history
…ated code (#11704)
  • Loading branch information
nizhikov authored Dec 10, 2024
1 parent cbd8973 commit 8e4642e
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,33 +56,21 @@ public enum IgniteFeatures {
/** Partition Map Exchange-free switch on baseline node left at fully rebalanced cluster. */
PME_FREE_SWITCH(19),

/** ContinuousQuery with security subject id support. */
CONT_QRY_SECURITY_AWARE(21),

/**
* Preventing loss of in-memory data when deactivating the cluster.
*
* @see ClusterState#INACTIVE
*/
SAFE_CLUSTER_DEACTIVATION(22),

/** Persistence caches can be snapshot. */
PERSISTENCE_CACHE_SNAPSHOT(23),

/** Remove metadata from cluster for specified type. */
REMOVE_METADATA(39),

/** Support policy of shutdown. */
SHUTDOWN_POLICY(40),

/** Compatibility support for new fields which are configured split. */
SPLITTED_CACHE_CONFIGURATIONS_V2(46),

/** Collecting performance statistics. */
PERFORMANCE_STATISTICS(48),

/** Restore cache group from the snapshot. */
SNAPSHOT_RESTORE_CACHE_GROUP(49);
SPLITTED_CACHE_CONFIGURATIONS_V2(46);

/**
* Unique feature identifier.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
import org.apache.ignite.internal.GridTopic;
import org.apache.ignite.internal.IgniteClientDisconnectedCheckedException;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteFeatures;
import org.apache.ignite.internal.IgniteFutureCancelledCheckedException;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
Expand Down Expand Up @@ -203,8 +202,6 @@
import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
import static org.apache.ignite.internal.GridClosureCallMode.BALANCE;
import static org.apache.ignite.internal.GridClosureCallMode.BROADCAST;
import static org.apache.ignite.internal.IgniteFeatures.PERSISTENCE_CACHE_SNAPSHOT;
import static org.apache.ignite.internal.IgniteFeatures.nodeSupports;
import static org.apache.ignite.internal.MarshallerContextImpl.mappingFileStoreWorkDir;
import static org.apache.ignite.internal.MarshallerContextImpl.resolveMappingFileStoreWorkDir;
import static org.apache.ignite.internal.MarshallerContextImpl.saveMappings;
Expand Down Expand Up @@ -2175,9 +2172,6 @@ public IgniteFutureImpl<Void> createSnapshot(
try {
cctx.kernalContext().security().authorize(ADMIN_SNAPSHOT);

if (!IgniteFeatures.allNodesSupports(cctx.discovery().aliveServerNodes(), PERSISTENCE_CACHE_SNAPSHOT))
throw new IgniteException("Not all nodes in the cluster support a snapshot operation.");

if (!cctx.kernalContext().state().clusterState().state().active())
throw new IgniteException("Snapshot operation has been rejected. The cluster is inactive.");

Expand Down Expand Up @@ -2534,9 +2528,6 @@ public IgniteInternalFuture<Void> requestRemoteSnapshotFiles(
"Remote node left the grid [rmtNodeId=" + rmtNodeId + ']');
}

if (!nodeSupports(rmtNode, PERSISTENCE_CACHE_SNAPSHOT))
throw new IgniteCheckedException("Snapshot on remote node is not supported: " + rmtNode.id());

RemoteSnapshotFilesRecevier fut =
new RemoteSnapshotFilesRecevier(this, rmtNodeId, reqId, snpName, rmtSnpPath, parts, stopChecker, partHnd);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.events.EventType;
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.IgniteFeatures;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.NodeStoppingException;
Expand Down Expand Up @@ -99,7 +98,6 @@
import org.jetbrains.annotations.Nullable;

import static java.util.Optional.ofNullable;
import static org.apache.ignite.internal.IgniteFeatures.SNAPSHOT_RESTORE_CACHE_GROUP;
import static org.apache.ignite.internal.MarshallerContextImpl.mappingFileStoreWorkDir;
import static org.apache.ignite.internal.pagemem.PageIdAllocator.INDEX_PARTITION;
import static org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl.binaryWorkDir;
Expand Down Expand Up @@ -283,9 +281,6 @@ public IgniteFutureImpl<Void> start(
if (!clusterState.hasBaselineTopology())
throw new IgniteException(OP_REJECT_MSG + "The baseline topology is not configured for cluster.");

if (!IgniteFeatures.allNodesSupports(ctx.grid().cluster().nodes(), SNAPSHOT_RESTORE_CACHE_GROUP))
throw new IgniteException(OP_REJECT_MSG + "Not all nodes in the cluster support restore operation.");

if (snpMgr.isSnapshotCreating())
throw new IgniteException(OP_REJECT_MSG + "A cluster snapshot operation is in progress.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@
import static javax.cache.event.EventType.UPDATED;
import static org.apache.ignite.events.EventType.EVT_CACHE_QUERY_OBJECT_READ;
import static org.apache.ignite.internal.GridTopic.TOPIC_CACHE;
import static org.apache.ignite.internal.IgniteFeatures.CONT_QRY_SECURITY_AWARE;
import static org.apache.ignite.internal.IgniteFeatures.allNodesSupports;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_CLIENT_MODE;

/**
Expand Down Expand Up @@ -883,7 +881,7 @@ private <T> T securityAwareComponent(T component, BiFunction<UUID, T, T> f) {

GridKernalContext ctx = cctx.kernalContext();

if (ctx.security().enabled() && allNodesSupports(ctx.discovery().allNodes(), CONT_QRY_SECURITY_AWARE)) {
if (ctx.security().enabled()) {
final UUID subjId = ctx.security().securityContext().subject().id();

return f.apply(subjId, component);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.apache.ignite.IgniteException;
import org.apache.ignite.cache.query.IndexQueryCriterion;
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.IgniteFeatures;
import org.apache.ignite.internal.NodeStoppingException;
import org.apache.ignite.internal.processors.GridProcessorAdapter;
import org.apache.ignite.internal.processors.cache.query.GridCacheQueryType;
Expand All @@ -44,7 +43,6 @@
import org.apache.ignite.lang.IgniteUuid;
import org.jetbrains.annotations.Nullable;

import static org.apache.ignite.internal.IgniteFeatures.allNodesSupports;
import static org.apache.ignite.internal.processors.metastorage.DistributedMetaStorage.IGNITE_INTERNAL_KEY_PREFIX;
import static org.apache.ignite.internal.util.distributed.DistributedProcess.DistributedProcessType.PERFORMANCE_STATISTICS_ROTATE;

Expand Down Expand Up @@ -295,9 +293,6 @@ public void pagesWriteThrottle(long endTime, long duration) {
public void startCollectStatistics() throws IgniteCheckedException {
A.notNull(metastorage, "Metastorage not ready. Node not started?");

if (!allNodesSupports(ctx.discovery().allNodes(), IgniteFeatures.PERFORMANCE_STATISTICS))
throw new IllegalStateException("Not all nodes in the cluster support collecting performance statistics.");

if (ctx.isStopping())
throw new NodeStoppingException("Operation has been cancelled (node is stopping)");

Expand Down

0 comments on commit 8e4642e

Please sign in to comment.