Additional debug
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8f1398f4 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8f1398f4 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8f1398f4 Branch: refs/heads/ignite-5398 Commit: 8f1398f43038700cdf66a4538d24c4dfd227cb0e Parents: b39f7c8 Author: Alexey Goncharuk <[email protected]> Authored: Mon May 15 12:47:38 2017 +0300 Committer: Alexey Goncharuk <[email protected]> Committed: Mon May 15 12:47:38 2017 +0300 ---------------------------------------------------------------------- .../distributed/dht/GridDhtLocalPartition.java | 2 +- .../dht/preloader/GridDhtPreloader.java | 26 ++++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/8f1398f4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java index aeb40f8..26f67e8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java @@ -669,7 +669,7 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>, /** * @param updateSeq Update sequence. */ - void tryEvictAsync(boolean updateSeq) { + public void tryEvictAsync(boolean updateSeq) { long reservations = state.get(); int ord = (int)(reservations >> 32); http://git-wip-us.apache.org/repos/asf/ignite/blob/8f1398f4/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 55f6bcb..d1d9462 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 @@ -23,6 +23,7 @@ import java.util.Collections; import java.util.List; import java.util.UUID; import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; @@ -30,6 +31,7 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.events.DiscoveryEvent; import org.apache.ignite.events.Event; +import org.apache.ignite.internal.IgniteFutureTimeoutCheckedException; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.NodeStoppingException; import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException; @@ -331,11 +333,25 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter { else { if (cctx.shared().database().persistenceEnabled()) { if (part.state() == RENTING || part.state() == EVICTED) { - try { - part.rent(false).get(); - } - catch (IgniteCheckedException e) { - U.error(log, "Error while clearing outdated local partition", e); + IgniteInternalFuture<?> rentFut = part.rent(false); + + while (true) { + try { + rentFut.get(20, TimeUnit.SECONDS); + + break; + } + catch (IgniteFutureTimeoutCheckedException ignore) { + // Continue. + U.warn(log, "Still waiting for partition eviction: " + part); + + part.tryEvictAsync(false); + } + catch (IgniteCheckedException e) { + U.error(log, "Error while clearing outdated local partition", e); + + break; + } } part = top.localPartition(p, topVer, true);
