This is an automated email from the ASF dual-hosted git repository.

apolovtsev 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 332aadac325 IGNITE-27715 Fix testMetastorageRaftSnapshotCompatibility 
(#7506)
332aadac325 is described below

commit 332aadac325b371261944d8bfe523f914a47a14c
Author: Phillippko <[email protected]>
AuthorDate: Tue Feb 3 10:52:26 2026 +0400

    IGNITE-27715 Fix testMetastorageRaftSnapshotCompatibility (#7506)
---
 .../ItMetastorageRaftSnapshotCompatibilityTest.java        |  4 +---
 .../ignite/internal/MetastorageRaftCompatibilityTest.java  |  5 +----
 .../org/apache/ignite/internal/CompatibilityTestBase.java  | 14 +++++++++++---
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git 
a/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/ItMetastorageRaftSnapshotCompatibilityTest.java
 
b/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/ItMetastorageRaftSnapshotCompatibilityTest.java
index a23a1137c08..d03299dfc1e 100644
--- 
a/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/ItMetastorageRaftSnapshotCompatibilityTest.java
+++ 
b/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/ItMetastorageRaftSnapshotCompatibilityTest.java
@@ -17,7 +17,6 @@
 
 package org.apache.ignite.internal;
 
-import static 
org.apache.ignite.internal.AssignmentsTestUtils.awaitAssignmentsStabilization;
 import static 
org.apache.ignite.internal.CompatibilityTestCommon.TABLE_NAME_TEST;
 import static 
org.apache.ignite.internal.CompatibilityTestCommon.createDefaultTables;
 import static org.apache.ignite.internal.TestWrappers.unwrapIgniteImpl;
@@ -63,9 +62,8 @@ public class ItMetastorageRaftSnapshotCompatibilityTest 
extends CompatibilityTes
     @Test
     void testMetastorageRaftSnapshotCompatibility() throws 
InterruptedException {
         cluster.stop();
-        cluster.startEmbedded(2);
 
-        awaitAssignmentsStabilization(node(0), TABLE_NAME_TEST);
+        startEmbeddedClusterAndAwaitRebalance(2);
 
         checkMetastorage();
 
diff --git 
a/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/MetastorageRaftCompatibilityTest.java
 
b/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/MetastorageRaftCompatibilityTest.java
index 67bef025a50..8d9c42e56c0 100644
--- 
a/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/MetastorageRaftCompatibilityTest.java
+++ 
b/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/MetastorageRaftCompatibilityTest.java
@@ -17,7 +17,6 @@
 
 package org.apache.ignite.internal;
 
-import static 
org.apache.ignite.internal.AssignmentsTestUtils.awaitAssignmentsStabilization;
 import static 
org.apache.ignite.internal.CompatibilityTestCommon.TABLE_NAME_TEST;
 import static 
org.apache.ignite.internal.CompatibilityTestCommon.createDefaultTables;
 import static org.apache.ignite.internal.TestWrappers.unwrapIgniteImpl;
@@ -84,9 +83,7 @@ public class MetastorageRaftCompatibilityTest extends 
CompatibilityTestBase {
 
     @Test
     void testStreamToFollower() throws InterruptedException {
-        cluster.startEmbedded(2);
-
-        awaitAssignmentsStabilization(node(0), TABLE_NAME_TEST);
+        startEmbeddedClusterAndAwaitRebalance(2);
 
         checkMetastorage();
 
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 8909538e1b4..da9d2a96b43 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
@@ -130,8 +130,7 @@ public abstract class CompatibilityTestBase extends 
BaseIgniteAbstractTest {
         if (restartWithCurrentEmbeddedVersion()) {
             cluster.stop();
 
-            cluster.startEmbedded(nodesCount);
-            await().until(this::noActiveRebalance, willBe(true));
+            startEmbeddedClusterAndAwaitRebalance(nodesCount);
         }
     }
 
@@ -256,12 +255,21 @@ public abstract class CompatibilityTestBase extends 
BaseIgniteAbstractTest {
         return false;
     }
 
+    /** Starts an embedded cluster with the given number of nodes and waits 
for rebalance to complete. */
+    protected void startEmbeddedClusterAndAwaitRebalance(int nodesCount) {
+        cluster.startEmbedded(nodesCount);
+
+        // TODO https://issues.apache.org/jira/browse/IGNITE-27719 SQL queries 
can fail during rebalance if they try to access partition on
+        //  a wrong node during rebalance.
+        await().until(this::noActiveRebalance, willBe(true));
+    }
+
     /**
      * Checks if there is an active rebalance happening. Does this by checking 
for pending assignments.
      *
      * @return {@code true} if there are no pending assignments in the 
metastorage.
      */
-    private CompletableFuture<Boolean> noActiveRebalance() {
+    protected CompletableFuture<Boolean> noActiveRebalance() {
         IgniteImpl node = unwrapIgniteImpl(node(0));
 
         ByteArray prefix = pendingAssignmentsQueuePrefix();

Reply via email to