diff --git a/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/ItReplicaLifecycleTest.java b/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/ItReplicaLifecycleTest.java index 1dfed729879..f2eadd5afe4 100644 --- a/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/ItReplicaLifecycleTest.java +++ b/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/ItReplicaLifecycleTest.java @@ -209,6 +209,7 @@ */ @ExtendWith({WorkDirectoryExtension.class, ConfigurationExtension.class}) @Timeout(60) +@Disabled("https://issues.apache.org/jira/browse/IGNITE-23063") // TODO: https://issues.apache.org/jira/browse/IGNITE-22522 remove this test after the switching to zone-based replication public class ItReplicaLifecycleTest extends BaseIgniteAbstractTest { private static final IgniteLogger LOG = Loggers.forClass(ItReplicaLifecycleTest.class); @@ -360,7 +361,6 @@ private void stopNode(int idx) { } @Test - @Disabled("https://issues.apache.org/jira/browse/IGNITE-22928") public void testZoneReplicaListener(TestInfo testInfo) throws Exception { startNodes(testInfo, 3); diff --git a/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/utils/TestPlacementDriver.java b/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/utils/TestPlacementDriver.java index fa70085543e..e7a2cb4fd8f 100644 --- a/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/utils/TestPlacementDriver.java +++ b/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/utils/TestPlacementDriver.java @@ -31,14 +31,16 @@ import org.apache.ignite.internal.placementdriver.event.PrimaryReplicaEvent; import org.apache.ignite.internal.placementdriver.event.PrimaryReplicaEventParameters; import org.apache.ignite.internal.replicator.ReplicationGroupId; +import org.apache.ignite.internal.replicator.ZonePartitionId; import org.apache.ignite.network.ClusterNode; /** * Trivial placement driver for tests. */ // TODO: https://issues.apache.org/jira/browse/IGNITE-22522 remove this code -public class TestPlacementDriver extends AbstractEventProducer implements - PlacementDriver { +public class TestPlacementDriver extends AbstractEventProducer + implements PlacementDriver { + private static final int DEFAULT_ZONE_ID = 0; private volatile ClusterNode primary; @@ -54,18 +56,17 @@ public void setPrimary(ClusterNode node) { @Override public CompletableFuture awaitPrimaryReplica(ReplicationGroupId groupId, HybridTimestamp timestamp, long timeout, TimeUnit unit) { - return getPrimaryReplicaMeta(); + return getPrimaryReplicaMeta(groupId); } @Override public CompletableFuture getPrimaryReplica(ReplicationGroupId replicationGroupId, HybridTimestamp timestamp) { - return getPrimaryReplicaMeta(); + return getPrimaryReplicaMeta(replicationGroupId); } @Override - public ReplicaMeta getCurrentPrimaryReplica(ReplicationGroupId replicationGroupId, - HybridTimestamp timestamp) { - return getPrimaryReplicaMeta().join(); + public ReplicaMeta getCurrentPrimaryReplica(ReplicationGroupId replicationGroupId, HybridTimestamp timestamp) { + return getPrimaryReplicaMeta(replicationGroupId).join(); } @Override @@ -81,7 +82,11 @@ public CompletableFuture> getAssignments( return failedFuture(new UnsupportedOperationException("getAssignments() is not supported in FakePlacementDriver yet.")); } - private CompletableFuture getPrimaryReplicaMeta() { + private CompletableFuture getPrimaryReplicaMeta(ReplicationGroupId replicationGroupId) { + if (replicationGroupId instanceof ZonePartitionId && ((ZonePartitionId) replicationGroupId).zoneId() == DEFAULT_ZONE_ID) { + return nullCompletedFuture(); + } + if (primary == null) { throw new IllegalStateException("Primary replica is not defined in test PlacementDriver"); }