Need to have an ability to cancel snapshot operations
fixing issues with multiple exchange future completion
@@ -234,6 +234,8 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
/** */
private volatile IgniteDhtPartitionsToReloadMap partsToReload = new IgniteDhtPartitionsToReloadMap();
+ private final AtomicBoolean done = new AtomicBoolean();
+
/**
* Dummy future created to trigger reassignments if partition
* topology changed while preloading.
@@ -1229,6 +1231,9 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
@Override public boolean onDone(@Nullable AffinityTopologyVersion res, @Nullable Throwable err) {
boolean realExchange = !dummy && !forcePreload;
+ if (!done.compareAndSet(false, true))
+ return dummy;
+
if (err == null && realExchange) {
for (GridCacheContext cacheCtx : cctx.cacheContexts()) {
if (cacheCtx.isLocal())
