Skip to content

Commit

Permalink
IGNITE-24092 Remove PRECISION_SCALE_SINCE_VER (#11803)
Browse files Browse the repository at this point in the history
  • Loading branch information
maksaska authored Jan 17, 2025
1 parent a70ed5d commit f5f229e
Showing 1 changed file with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.CU;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteProductVersion;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.plugin.security.SecurityException;
import org.apache.ignite.spi.IgniteNodeValidationResult;
Expand Down Expand Up @@ -103,9 +102,6 @@ public class ValidationOnNodeJoinUtils {
private static final String ENCRYPT_MISMATCH_MESSAGE = "Failed to join node to the cluster " +
"(encryption settings are different for cache '%s' : local=%s, remote=%s.)";

/** Supports non default precision and scale for DECIMAL and VARCHAR types. */
private static final IgniteProductVersion PRECISION_SCALE_SINCE_VER = IgniteProductVersion.fromString("2.7.0");

/** Invalid region configuration message. */
private static final String INVALID_REGION_CONFIGURATION_MESSAGE = "Failed to join node (Incompatible data region configuration " +
"[region=%s, locNodeId=%s, isPersistenceEnabled=%s, rmtNodeId=%s, isPersistenceEnabled=%s])";
Expand Down Expand Up @@ -403,22 +399,6 @@ else if (cc.getRebalanceMode() == SYNC) {
throw new IgniteCheckedException("Encryption cannot be used with disk page compression " +
cacheSpec.toString());
}

Collection<QueryEntity> ents = cc.getQueryEntities();

if (ctx.discovery().discoCache() != null) {
boolean nonDfltPrecScaleExists = ents.stream().anyMatch(
e -> !F.isEmpty(e.getFieldsPrecision()) || !F.isEmpty(e.getFieldsScale()));

if (nonDfltPrecScaleExists) {
ClusterNode oldestNode = ctx.discovery().discoCache().oldestServerNode();

if (PRECISION_SCALE_SINCE_VER.compareTo(oldestNode.version()) > 0) {
throw new IgniteCheckedException("Non default precision and scale is supported since version 2.7. " +
"The node with oldest version [node=" + oldestNode + ']');
}
}
}
}

/**
Expand Down

0 comments on commit f5f229e

Please sign in to comment.