You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by rp...@apache.org on 2025/03/20 13:51:11 UTC
(ignite-3) branch main updated: IGNITE-24880 Support per-zone partitions in tests of table module (#5459)
This is an automated email from the ASF dual-hosted git repository.
rpuch pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new f7f72d091ff IGNITE-24880 Support per-zone partitions in tests of table module (#5459)
f7f72d091ff is described below
commit f7f72d091ffdfc7cbbe26d78405dc785d5e66f61
Author: Roman Puchkovskiy <ro...@gmail.com>
AuthorDate: Thu Mar 20 17:51:05 2025 +0400
IGNITE-24880 Support per-zone partitions in tests of table module (#5459)
---
.../distributed/ItTxObservableTimePropagationTest.java | 18 +++++++++++++++---
.../apache/ignite/internal/ItRaftFsyncOptionTest.java | 4 ++--
.../ignite/internal/table/TxInfrastructureTest.java | 2 +-
3 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/modules/table/src/integrationTest/java/org/apache/ignite/distributed/ItTxObservableTimePropagationTest.java b/modules/table/src/integrationTest/java/org/apache/ignite/distributed/ItTxObservableTimePropagationTest.java
index 1173dc7cbf1..f34c91a1347 100644
--- a/modules/table/src/integrationTest/java/org/apache/ignite/distributed/ItTxObservableTimePropagationTest.java
+++ b/modules/table/src/integrationTest/java/org/apache/ignite/distributed/ItTxObservableTimePropagationTest.java
@@ -18,6 +18,7 @@
package org.apache.ignite.distributed;
import static org.apache.ignite.distributed.ItTxTestCluster.NODE_PORT_BASE;
+import static org.apache.ignite.internal.lang.IgniteSystemProperties.enabledColocation;
import static org.apache.ignite.internal.tx.impl.ResourceVacuumManager.RESOURCE_VACUUM_INTERVAL_MILLISECONDS_PROPERTY;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
@@ -31,9 +32,12 @@ import org.apache.ignite.internal.hlc.HybridClock;
import org.apache.ignite.internal.hlc.HybridTimestamp;
import org.apache.ignite.internal.logger.IgniteLogger;
import org.apache.ignite.internal.logger.Loggers;
+import org.apache.ignite.internal.partition.replicator.raft.ZonePartitionRaftListener;
import org.apache.ignite.internal.raft.Loza;
import org.apache.ignite.internal.raft.server.impl.JraftServerImpl;
-import org.apache.ignite.internal.replicator.TablePartitionId;
+import org.apache.ignite.internal.raft.server.impl.JraftServerImpl.DelegatingStateMachine;
+import org.apache.ignite.internal.replicator.ReplicationGroupId;
+import org.apache.ignite.internal.table.TableViewInternal;
import org.apache.ignite.internal.table.TxInfrastructureTest;
import org.apache.ignite.internal.table.distributed.raft.PartitionListener;
import org.apache.ignite.internal.testframework.IgniteTestUtils;
@@ -110,7 +114,7 @@ public class ItTxObservableTimePropagationTest extends TxInfrastructureTest {
assertTrue(commitTs.compareTo(new HybridTimestamp(CLIENT_FROZEN_PHYSICAL_TIME, 0)) > 0, "Observable timestamp should be advanced");
- TablePartitionId part = new TablePartitionId(accounts.tableId(), 0);
+ ReplicationGroupId part = replicationGroupId(accounts, 0);
NodeImpl[] handle = {null};
NodeImpl[] leader = {null};
@@ -135,7 +139,7 @@ public class ItTxObservableTimePropagationTest extends TxInfrastructureTest {
}
var fsm = (JraftServerImpl.DelegatingStateMachine) raftNode.getOptions().getFsm();
- PartitionListener listener = (PartitionListener) fsm.getListener();
+ PartitionListener listener = extractPartitionListener(fsm, accounts);
PendingComparableValuesTracker<HybridTimestamp, Void> safeTime = listener.getSafeTimeTracker();
try {
@@ -168,4 +172,12 @@ public class ItTxObservableTimePropagationTest extends TxInfrastructureTest {
assertTrue(commitTs2.compareTo(commitTs) > 0, "Invalid safe time");
}
+
+ private static PartitionListener extractPartitionListener(DelegatingStateMachine fsm, TableViewInternal table) {
+ if (enabledColocation()) {
+ return (PartitionListener) ((ZonePartitionRaftListener) fsm.getListener()).tableProcessor(table.tableId());
+ } else {
+ return (PartitionListener) fsm.getListener();
+ }
+ }
}
diff --git a/modules/table/src/integrationTest/java/org/apache/ignite/internal/ItRaftFsyncOptionTest.java b/modules/table/src/integrationTest/java/org/apache/ignite/internal/ItRaftFsyncOptionTest.java
index 3e169d28c61..bce75b6ece1 100644
--- a/modules/table/src/integrationTest/java/org/apache/ignite/internal/ItRaftFsyncOptionTest.java
+++ b/modules/table/src/integrationTest/java/org/apache/ignite/internal/ItRaftFsyncOptionTest.java
@@ -27,7 +27,7 @@ import org.apache.ignite.internal.raft.RaftNodeId;
import org.apache.ignite.internal.raft.server.impl.JraftServerImpl;
import org.apache.ignite.internal.raft.storage.impl.DefaultLogStorageFactory;
import org.apache.ignite.internal.raft.storage.impl.IgniteJraftServiceFactory;
-import org.apache.ignite.internal.replicator.TablePartitionId;
+import org.apache.ignite.internal.replicator.PartitionGroupId;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.rocksdb.DBOptions;
@@ -52,7 +52,7 @@ class ItRaftFsyncOptionTest extends ClusterPerTestIntegrationTest {
RaftNodeId metastorageNodeId = findRaftNodeId(id -> id.groupId() == MetastorageGroupId.INSTANCE);
assertFsyncIsAsExpectedOn(metastorageNodeId, true);
- RaftNodeId partitionNodeId = findRaftNodeId(id -> id.groupId() instanceof TablePartitionId);
+ RaftNodeId partitionNodeId = findRaftNodeId(id -> id.groupId() instanceof PartitionGroupId);
assertFsyncIsAsExpectedOn(partitionNodeId, fsyncInConfig);
}
diff --git a/modules/table/src/testFixtures/java/org/apache/ignite/internal/table/TxInfrastructureTest.java b/modules/table/src/testFixtures/java/org/apache/ignite/internal/table/TxInfrastructureTest.java
index 30af1559b7d..facfa92acd9 100644
--- a/modules/table/src/testFixtures/java/org/apache/ignite/internal/table/TxInfrastructureTest.java
+++ b/modules/table/src/testFixtures/java/org/apache/ignite/internal/table/TxInfrastructureTest.java
@@ -377,7 +377,7 @@ public abstract class TxInfrastructureTest extends IgniteAbstractTest {
}
// TODO https://issues.apache.org/jira/browse/IGNITE-22522 Remove TablePartitionId part.
- private static ReplicationGroupId replicationGroupId(TableViewInternal tableViewInternal, int partitionIndex) {
+ protected static ReplicationGroupId replicationGroupId(TableViewInternal tableViewInternal, int partitionIndex) {
return enabledColocation() ? new ZonePartitionId(tableViewInternal.internalTable().zoneId(), partitionIndex) :
new TablePartitionId(tableViewInternal.tableId(), partitionIndex);
}