GridDhtForceKeysFuture: now when rebalancing is disabled partition can be in OWNED state, fixed future logic.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4fbc3889 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4fbc3889 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4fbc3889 Branch: refs/heads/ignite-3477 Commit: 4fbc38893673fbf896c9d946a7ff1154aaa92a8b Parents: bb42516 Author: sboikov <[email protected]> Authored: Tue Jan 10 15:52:30 2017 +0300 Committer: sboikov <[email protected]> Committed: Tue Jan 10 15:52:30 2017 +0300 ---------------------------------------------------------------------- .../distributed/dht/preloader/GridDhtForceKeysFuture.java | 10 ++++------ .../cache/distributed/dht/preloader/GridDhtPreloader.java | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/4fbc3889/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java index 7cbd77c..2f58ca9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java @@ -170,7 +170,7 @@ public final class GridDhtForceKeysFuture<K, V> extends GridCompoundFuture<Objec * @param evt Discovery event. */ @SuppressWarnings( {"unchecked"}) - public void onDiscoveryEvent(DiscoveryEvent evt) { + void onDiscoveryEvent(DiscoveryEvent evt) { topCntr.incrementAndGet(); int type = evt.type(); @@ -194,11 +194,10 @@ public final class GridDhtForceKeysFuture<K, V> extends GridCompoundFuture<Objec } /** - * @param nodeId Node left callback. * @param res Response. */ @SuppressWarnings( {"unchecked"}) - public void onResult(UUID nodeId, GridDhtForceKeysResponse res) { + public void onResult(GridDhtForceKeysResponse res) { for (IgniteInternalFuture<Object> f : futures()) if (isMini(f)) { MiniFuture mini = (MiniFuture)f; @@ -355,8 +354,7 @@ public final class GridDhtForceKeysFuture<K, V> extends GridCompoundFuture<Objec if (locPart == null) invalidParts.add(part); - // If rebalance is disabled, then local partition is always MOVING. - else if (locPart.state() == MOVING) { + else if (!cctx.rebalanceEnabled() || locPart.state() == MOVING) { Collections.sort(owners, CU.nodeComparator(false)); // Load from youngest owner. @@ -541,7 +539,7 @@ public final class GridDhtForceKeysFuture<K, V> extends GridCompoundFuture<Objec GridDhtLocalPartition locPart = top.localPartition(p, AffinityTopologyVersion.NONE, false); - if (locPart != null && locPart.state() == MOVING && locPart.reserve()) { + if (locPart != null && (!cctx.rebalanceEnabled() || locPart.state() == MOVING) && locPart.reserve()) { GridCacheEntryEx entry = cctx.dht().entryEx(info.key()); try { http://git-wip-us.apache.org/repos/asf/ignite/blob/4fbc3889/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 1c67d3c..c5fab1a 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 @@ -572,7 +572,7 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter { GridDhtForceKeysFuture<?, ?> f = forceKeyFuts.get(msg.futureId()); if (f != null) - f.onResult(node.id(), msg); + f.onResult(msg); else if (log.isDebugEnabled()) log.debug("Receive force key response for unknown future (is it duplicate?) [nodeId=" + node.id() + ", res=" + msg + ']');
