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

wernerdv pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 1dbc955fdbe IGNITE-28832 Fix flaky 
StatisticsConfigurationTest.updateStatisticsOnChangeTopology[persist=true] 
(#13293)
1dbc955fdbe is described below

commit 1dbc955fdbecdd60f8380ef881d8b38926625806
Author: Dmitry Werner <[email protected]>
AuthorDate: Fri Sep 11 10:39:07 2026 +0500

    IGNITE-28832 Fix flaky 
StatisticsConfigurationTest.updateStatisticsOnChangeTopology[persist=true] 
(#13293)
---
 .../query/stat/StatisticsConfigurationTest.java    | 30 ++++++++++++++--------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/stat/StatisticsConfigurationTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/stat/StatisticsConfigurationTest.java
index eced0606697..b28a822baf5 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/stat/StatisticsConfigurationTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/stat/StatisticsConfigurationTest.java
@@ -34,7 +34,6 @@ import 
org.apache.ignite.internal.IgniteInterruptedCheckedException;
 import 
org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager;
 import 
org.apache.ignite.internal.processors.query.stat.config.StatisticsObjectConfiguration;
 import 
org.apache.ignite.internal.processors.query.stat.messages.StatisticsObjectData;
-import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.G;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.testframework.GridTestUtils;
@@ -135,14 +134,26 @@ public class StatisticsConfigurationTest extends 
StatisticsAbstractTest {
         cleanPersistenceDir();
     }
 
+    /** {@inheritDoc} */
+    @Override protected long getPartitionMapExchangeTimeout() {
+        return super.getPartitionMapExchangeTimeout() * 3;
+    }
+
     /** */
     protected IgniteEx startGridAndChangeBaseline(int nodeIdx) throws 
Exception {
         IgniteEx ign = startGrid(nodeIdx);
 
         ign.cluster().state(ClusterState.ACTIVE);
 
-        if (persist)
-            ign.cluster().setBaselineTopology(ign.cluster().topologyVersion());
+        if (persist && nodeIdx == 0) {
+            // Enable baseline auto-adjust with zero timeout so that the 
baseline
+            // is updated immediately when nodes join or leave. This prevents
+            // partitions from becoming LOST (which would require 
resetLostPartitions
+            // and cause data loss). With auto-adjust, backups are promoted to
+            // primaries before detectLostPartitions runs in the exchange.
+            ign.cluster().baselineAutoAdjustEnabled(true);
+            ign.cluster().baselineAutoAdjustTimeout(0);
+        }
 
         awaitPartitionMapExchange();
 
@@ -150,16 +161,13 @@ public class StatisticsConfigurationTest extends 
StatisticsAbstractTest {
     }
 
     /** */
-    protected void stopGridAndChangeBaseline(int nodeIdx) {
+    protected void stopGridAndAwaitPme(int nodeIdx) {
         stopGrid(nodeIdx);
 
-        if (persist)
-            
F.first(G.allGrids()).cluster().setBaselineTopology(F.first(G.allGrids()).cluster().topologyVersion());
-
         try {
             awaitPartitionMapExchange();
         }
-        catch (InterruptedException e) {
+        catch (InterruptedException ignored) {
             // No-op.
         }
     }
@@ -292,17 +300,17 @@ public class StatisticsConfigurationTest extends 
StatisticsAbstractTest {
         waitForStats(SCHEMA, "SMALL", TIMEOUT, checkTotalRows, 
checkColumStats);
 
         log.info("Stoppping server 0 node");
-        stopGridAndChangeBaseline(0);
+        stopGridAndAwaitPme(0);
 
         waitForStats(SCHEMA, "SMALL", TIMEOUT, checkTotalRows, 
checkColumStats);
 
         log.info("Stopping server 2 node");
-        stopGridAndChangeBaseline(2);
+        stopGridAndAwaitPme(2);
 
         waitForStats(SCHEMA, "SMALL", TIMEOUT, checkTotalRows, 
checkColumStats);
 
         log.info("Stopping server 3 node");
-        stopGridAndChangeBaseline(3);
+        stopGridAndAwaitPme(3);
 
         waitForStats(SCHEMA, "SMALL", TIMEOUT, checkTotalRows, 
checkColumStats);
 

Reply via email to