Skip to content

Commit d9a30e8

Browse files
committed
Fixed CacheGetFromJobTest failure (wait for correct exchange version for cache start operation).
1 parent 86465f5 commit d9a30e8

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,18 @@ boolean onCacheChangeRequested(DynamicCacheChangeBatch batch, AffinityTopologyVe
350350
if (!needExchange && desc != null) {
351351
if (desc.clientCacheStartVersion() != null)
352352
waitTopVer = desc.clientCacheStartVersion();
353-
else
354-
waitTopVer = desc.startTopologyVersion();
353+
else {
354+
AffinityTopologyVersion nodeStartVer =
355+
new AffinityTopologyVersion(ctx.discovery().localNode().order(), 0);
356+
357+
if (desc.startTopologyVersion() != null)
358+
waitTopVer = desc.startTopologyVersion();
359+
else
360+
waitTopVer = desc.receivedFromStartVersion();
361+
362+
if (waitTopVer == null || nodeStartVer.compareTo(waitTopVer) > 0)
363+
waitTopVer = nodeStartVer;
364+
}
355365
}
356366
}
357367
else if (req.globalStateChange())

modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetFromJobTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ public class CacheGetFromJobTest extends GridCacheAbstractSelfTest {
4141
stopAllGrids();
4242
}
4343

44+
/** {@inheritDoc} */
45+
@Override protected long getTestTimeout() {
46+
return 5 * 60_000;
47+
}
48+
4449
/**
4550
* @throws Exception If failed.
4651
*/

0 commit comments

Comments
 (0)