ignite-3477 : Fixed possible endless iteration over queue with evicted patitions.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5cded42e Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5cded42e Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5cded42e Branch: refs/heads/ignite-3477-master Commit: 5cded42e8a45cd799122061499e0c95b00803504 Parents: face0c7 Author: Ilya Lantukh <[email protected]> Authored: Wed Apr 12 12:43:49 2017 +0300 Committer: Ilya Lantukh <[email protected]> Committed: Wed Apr 12 12:43:49 2017 +0300 ---------------------------------------------------------------------- .../cache/distributed/dht/preloader/GridDhtPreloader.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/5cded42e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java index c033b93..517f04a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java @@ -47,6 +47,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAffini import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtFuture; import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtInvalidPartitionException; import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition; +import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState; import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology; import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicAbstractUpdateRequest; import org.apache.ignite.internal.util.future.GridCompoundFuture; @@ -72,6 +73,7 @@ import static org.apache.ignite.events.EventType.EVT_NODE_JOINED; import static org.apache.ignite.events.EventType.EVT_NODE_LEFT; import static org.apache.ignite.internal.managers.communication.GridIoPolicy.AFFINITY_POOL; import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.MOVING; +import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.OWNING; import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.RENTING; import static org.apache.ignite.internal.util.GridConcurrentFactory.newMap; @@ -790,7 +792,9 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter { try { part.tryEvict(); - if (part.state() == RENTING || part.shouldBeRenting()) + GridDhtPartitionState state = part.state(); + + if (state == RENTING || ((state == MOVING || state == OWNING) && part.shouldBeRenting())) partsToEvict.push(part); } catch (Throwable ex) {
