Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander;
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;
Expand Down Expand Up @@ -135,6 +136,11 @@ public static List<Object[]> parameters() {
cleanPersistenceDir();
}

/** {@inheritDoc} */
@Override protected long getPartitionMapExchangeTimeout() {
return super.getPartitionMapExchangeTimeout() * 3;
}

/** */
protected IgniteEx startGridAndChangeBaseline(int nodeIdx) throws Exception {
IgniteEx ign = startGrid(nodeIdx);
Expand All @@ -150,12 +156,35 @@ protected IgniteEx startGridAndChangeBaseline(int nodeIdx) throws Exception {
}

/** */
protected void stopGridAndChangeBaseline(int nodeIdx) {
protected void stopGridAndChangeBaseline(int nodeIdx) throws Exception {
stopGrid(nodeIdx);

if (persist)
if (persist) {
F.first(G.allGrids()).cluster().setBaselineTopology(F.first(G.allGrids()).cluster().topologyVersion());

// Wait for rebalancing to finish on all nodes after baseline change.
// setBaselineTopology triggers a full exchange with async rebalancing.
// awaitPartitionMapExchange checks ownerNodesCnt against readyAffinityVersion,
// but partition topology (MOVING) lags behind — causing infinite loop and timeout.
// We wait for the rebalance future to complete (blocking.get()) before proceeding.
for (Ignite grid : G.allGrids()) {
IgniteEx ign = (IgniteEx)grid;

if (ign.cluster().localNode().isClient())
continue;

// Wait for ongoing rebalance to complete.
GridDhtPartitionDemander.RebalanceFuture rebFut = (GridDhtPartitionDemander.RebalanceFuture)ign
.cachex("SMALLnull").context().preloader().rebalanceFuture();

// If rebalance was cancelled (false), a new one may have started — retry.
while (!rebFut.isInitial() && !rebFut.get()) {
rebFut = (GridDhtPartitionDemander.RebalanceFuture)ign.cachex("SMALLnull")
.context().preloader().rebalanceFuture();
}
}
}

try {
awaitPartitionMapExchange();
}
Expand Down