You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by tk...@apache.org on 2025/09/19 12:47:33 UTC
(ignite-3) 02/02: IGNITE-26095 wip
This is an automated email from the ASF dual-hosted git repository.
tkalkirill pushed a commit to branch ignite-26095
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit 5193e8518803506fe6d2eb4ee0aa1793ae6b9b5c
Author: Kirill Tkalenko <tk...@yandex.ru>
AuthorDate: Fri Sep 19 15:47:09 2025 +0300
IGNITE-26095 wip
---
...RaftLogWithChangeReplicasCompatibilityTest.java | 22 +++++++++++++++-------
.../ignite/internal/CompatibilityTestBase.java | 5 ++++-
.../org/apache/ignite/internal/RunnerNode.java | 7 ++++---
3 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/ItPartitionRaftLogWithChangeReplicasCompatibilityTest.java b/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/ItPartitionRaftLogWithChangeReplicasCompatibilityTest.java
index a7eaecdfec9..a6788c19df7 100644
--- a/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/ItPartitionRaftLogWithChangeReplicasCompatibilityTest.java
+++ b/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/ItPartitionRaftLogWithChangeReplicasCompatibilityTest.java
@@ -21,21 +21,22 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasSize;
import org.apache.ignite.Ignite;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedClass;
import org.junit.jupiter.params.provider.MethodSource;
-/** Partition Raft log compatibility tests when adding replicas. */
+/** Partition Raft log compatibility tests when changing replicas. */
@ParameterizedClass
@MethodSource("baseVersions")
-public class ItPartitionRaftLogWithAddReplicasCompatibilityTest extends CompatibilityTestBase {
+public class ItPartitionRaftLogWithChangeReplicasCompatibilityTest extends CompatibilityTestBase {
private static final String ZONE_NAME = "TEST_ZONE";
private static final String TABLE_NAME = "TEST_TABLE";
@Override
protected int nodesCount() {
- return 1;
+ return 3;
}
@Override
@@ -45,7 +46,12 @@ public class ItPartitionRaftLogWithAddReplicasCompatibilityTest extends Compatib
@Override
protected void setupBaseVersion(Ignite baseIgnite) {
- sql(baseIgnite, String.format("CREATE ZONE %s WITH PARTITIONS=1, REPLICAS=1, STORAGE_PROFILES='default'", ZONE_NAME));
+ String createZoneDdl = String.format(
+ "CREATE ZONE %s WITH PARTITIONS=1, REPLICAS=1, STORAGE_PROFILES='default', DATA_NODES_FILTER='$[?(@.nodeIndex == \"0\")]'",
+ ZONE_NAME
+ );
+
+ sql(baseIgnite, createZoneDdl);
sql(baseIgnite, String.format("CREATE TABLE %s(ID INT PRIMARY KEY, VAL VARCHAR) ZONE %s", TABLE_NAME, ZONE_NAME));
@@ -58,17 +64,19 @@ public class ItPartitionRaftLogWithAddReplicasCompatibilityTest extends Compatib
});
}
+ @Disabled("https://issues.apache.org/jira/browse/IGNITE-26479")
@Test
void testIncreaseReplicas() throws Exception {
cluster.stop();
- cluster.startEmbedded(nodesCount() + 2, true);
+ cluster.startEmbedded(nodesCount(), false);
- sql(String.format("ALTER ZONE %s SET REPLICAS=3", ZONE_NAME));
+ sql(String.format("ALTER ZONE %s SET REPLICAS=3, DATA_NODES_FILTER='$..*'", ZONE_NAME));
// Let's wait for replication to complete on other nodes.
Thread.sleep(3_000);
- assertThat(sql(String.format("SELECT * FROM %s", TABLE_NAME)), hasSize(10));
+ assertThat(sql(cluster.node(1), String.format("SELECT * FROM %s", TABLE_NAME)), hasSize(10));
+ assertThat(sql(cluster.node(2), String.format("SELECT * FROM %s", TABLE_NAME)), hasSize(10));
}
}
diff --git a/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestBase.java b/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestBase.java
index 948559e35f6..e95e2f67a86 100644
--- a/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestBase.java
+++ b/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestBase.java
@@ -66,7 +66,10 @@ public abstract class CompatibilityTestBase extends BaseIgniteAbstractTest {
+ " clientConnector.port: {},\n"
+ " clientConnector.sendServerExceptionStackTraceToClient: true,\n"
+ " rest.port: {},\n"
- + " failureHandler.dumpThreadsOnFailure: false\n"
+ + " failureHandler.dumpThreadsOnFailure: false,\n"
+ + " nodeAttributes: {\n"
+ + " nodeAttributes: {nodeName: \"{}\", nodeIndex: \"{}\"}\n"
+ + " }\n"
+ "}";
// If there are no fields annotated with @Parameter, constructor injection will be used, which is incompatible with the
diff --git a/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/RunnerNode.java b/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/RunnerNode.java
index 9031d92ad11..6efa40e8541 100644
--- a/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/RunnerNode.java
+++ b/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/RunnerNode.java
@@ -81,7 +81,7 @@ public class RunnerNode {
) throws IOException {
String nodeName = clusterConfiguration.nodeNamingStrategy().nodeName(clusterConfiguration, nodeIndex);
Path workDir = clusterConfiguration.workDir().resolve(clusterConfiguration.clusterName()).resolve(nodeName);
- String configStr = formatConfig(clusterConfiguration, nodeIndex, nodesCount);
+ String configStr = formatConfig(clusterConfiguration, nodeName, nodeIndex, nodesCount);
Files.createDirectories(workDir);
Path configPath = workDir.resolve(DEFAULT_CONFIG_NAME);
@@ -179,14 +179,15 @@ public class RunnerNode {
.collect(joining(", "));
}
- private static String formatConfig(ClusterConfiguration clusterConfiguration, int nodeIndex, int nodesCount) {
+ private static String formatConfig(ClusterConfiguration clusterConfiguration, String nodeName, int nodeIndex, int nodesCount) {
return IgniteStringFormatter.format(
clusterConfiguration.defaultNodeBootstrapConfigTemplate(),
clusterConfiguration.basePort() + nodeIndex,
seedAddressesString(clusterConfiguration, nodesCount),
clusterConfiguration.baseClientPort() + nodeIndex,
clusterConfiguration.baseHttpPort() + nodeIndex,
- clusterConfiguration.baseHttpsPort() + nodeIndex
+ nodeName,
+ nodeIndex
);
}