You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/06/03 17:06:18 UTC
[17/42] incubator-ignite git commit: ignite-968 wait for init future
before processing message
ignite-968 wait for init future before processing message
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4e563ed8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4e563ed8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4e563ed8
Branch: refs/heads/ignite-883_1
Commit: 4e563ed8985a52722de0b263eb486cd7d945053f
Parents: 2f61522
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 2 09:52:45 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 2 09:52:45 2015 +0300
----------------------------------------------------------------------
.../GridDhtPartitionsExchangeFuture.java | 46 ++++++++++----------
1 file changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4e563ed8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 145def8..db43c6c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -1140,39 +1140,39 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
return;
}
- ClusterNode curOldest = oldestNode.get();
+ if (log.isDebugEnabled())
+ log.debug("Received full partition map from node [nodeId=" + nodeId + ", msg=" + msg + ']');
- if (!nodeId.equals(curOldest.id())) {
- if (log.isDebugEnabled())
- log.debug("Received full partition map from unexpected node [oldest=" + curOldest.id() +
- ", unexpectedNodeId=" + nodeId + ']');
+ assert exchId.topologyVersion().equals(msg.topologyVersion());
- ClusterNode snd = cctx.discovery().node(nodeId);
+ initFut.listen(new CI1<IgniteInternalFuture<Boolean>>() {
+ @Override public void apply(IgniteInternalFuture<Boolean> t) {
+ ClusterNode curOldest = oldestNode.get();
- if (snd == null) {
- if (log.isDebugEnabled())
- log.debug("Sender node left grid, will ignore message from unexpected node [nodeId=" + nodeId +
- ", exchId=" + msg.exchangeId() + ']');
+ if (!nodeId.equals(curOldest.id())) {
+ if (log.isDebugEnabled())
+ log.debug("Received full partition map from unexpected node [oldest=" + curOldest.id() +
+ ", unexpectedNodeId=" + nodeId + ']');
- return;
- }
+ ClusterNode snd = cctx.discovery().node(nodeId);
- // Will process message later if sender node becomes oldest node.
- if (snd.order() > curOldest.order())
- fullMsgs.put(nodeId, msg);
+ if (snd == null) {
+ if (log.isDebugEnabled())
+ log.debug("Sender node left grid, will ignore message from unexpected node [nodeId=" + nodeId +
+ ", exchId=" + msg.exchangeId() + ']');
- return;
- }
+ return;
+ }
- assert msg.exchangeId().equals(exchId);
+ // Will process message later if sender node becomes oldest node.
+ if (snd.order() > curOldest.order())
+ fullMsgs.put(nodeId, msg);
- if (log.isDebugEnabled())
- log.debug("Received full partition map from node [nodeId=" + nodeId + ", msg=" + msg + ']');
+ return;
+ }
- assert exchId.topologyVersion().equals(msg.topologyVersion());
+ assert msg.exchangeId().equals(exchId);
- initFut.listen(new CI1<IgniteInternalFuture<Boolean>>() {
- @Override public void apply(IgniteInternalFuture<Boolean> t) {
assert msg.lastVersion() != null;
cctx.versions().onReceived(nodeId, msg.lastVersion());