Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C704C185C1 for ; Mon, 17 Aug 2015 11:07:54 +0000 (UTC) Received: (qmail 11589 invoked by uid 500); 17 Aug 2015 11:07:54 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 11517 invoked by uid 500); 17 Aug 2015 11:07:54 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 11501 invoked by uid 99); 17 Aug 2015 11:07:54 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Aug 2015 11:07:54 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 448AD1AA31C for ; Mon, 17 Aug 2015 11:07:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.775 X-Spam-Level: * X-Spam-Status: No, score=1.775 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.006, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id slKLwzAg9ETN for ; Mon, 17 Aug 2015 11:07:52 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id AE0B521472 for ; Mon, 17 Aug 2015 11:07:50 +0000 (UTC) Received: (qmail 11180 invoked by uid 99); 17 Aug 2015 11:07:49 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Aug 2015 11:07:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D42B5E01F5; Mon, 17 Aug 2015 11:07:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Mon, 17 Aug 2015 11:07:59 -0000 Message-Id: <89e1d3b04fcd4bc68705797ce2c9421c@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [12/12] incubator-ignite git commit: # Merge remote-tracking branch 'remotes/origin/master' into ignite-426 # Merge remote-tracking branch 'remotes/origin/master' into ignite-426 Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/25f8f419 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/25f8f419 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/25f8f419 Branch: refs/heads/ignite-426 Commit: 25f8f419bf75f8c6b83ecbe6cff29865a2d5548d Parents: f0b24c4 1f00c70 Author: sboikov Authored: Mon Aug 17 14:06:52 2015 +0300 Committer: sboikov Committed: Mon Aug 17 14:06:52 2015 +0300 ---------------------------------------------------------------------- .../CachePartialUpdateCheckedException.java | 29 +++- .../processors/cache/GridCacheAdapter.java | 161 ++++++++++++++++--- .../processors/cache/GridCacheMapEntry.java | 4 +- .../dht/atomic/GridNearAtomicUpdateFuture.java | 61 +++++-- .../near/GridNearOptimisticTxPrepareFuture.java | 2 +- ...cheDhtLocalPartitionAfterRemoveSelfTest.java | 33 ++-- .../cache/GridCacheAbstractFullApiSelfTest.java | 1 - .../IgniteCacheSizeFailoverTest.java | 115 +++++++++++++ .../IgniteCachePutRetryAbstractSelfTest.java | 120 +++++++++++--- ...PutRetryAtomicPrimaryWriteOrderSelfTest.java | 32 ++++ .../tcp/IgniteCacheSslStartStopSelfTest.java | 1 + .../IgniteCacheFailoverTestSuite.java | 3 + .../testsuites/IgniteCacheTestSuite2.java | 1 + 13 files changed, 494 insertions(+), 69 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/25f8f419/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/25f8f419/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java ---------------------------------------------------------------------- diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java index eec7fa0,e527f08..1a779ad --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java @@@ -287,24 -284,14 +288,24 @@@ public class GridNearAtomicUpdateFutur return false; } - GridNearAtomicUpdateRequest req = mappings.get(nodeId); + Collection mappingKeys = new ArrayList<>(mappings.size()); + Collection failedKeys = new ArrayList<>(); + + for (Map.Entry e : mappings.entrySet()) { + if (e.getKey().nodeId().equals(nodeId)) { + mappingKeys.add(e.getKey()); + + failedKeys.addAll(e.getValue().keys()); + } + } - if (req != null) { - addFailedKeys(req.keys(), - req.topologyVersion(), - new ClusterTopologyCheckedException("Primary node left grid before response is received: " + nodeId)); + if (!mappingKeys.isEmpty()) { - if (!failedKeys.isEmpty()) - addFailedKeys(failedKeys, new ClusterTopologyCheckedException("Primary node left grid before " + ++ if (!failedKeys.isEmpty()) // TODO: top ver. ++ addFailedKeys(failedKeys, null, new ClusterTopologyCheckedException("Primary node left grid before " + + "response is received: " + nodeId)); - mappings.remove(nodeId); + for (GridAtomicMappingKey key : mappingKeys) + mappings.remove(key); checkComplete(); @@@ -466,14 -479,17 +489,17 @@@ X.hasCause(err, ClusterTopologyCheckedException.class) && storeFuture() && remapCnt.decrementAndGet() > 0) { + ClusterTopologyCheckedException topErr = X.cause(err, ClusterTopologyCheckedException.class); - CachePartialUpdateCheckedException cause = X.cause(err, CachePartialUpdateCheckedException.class); + if (!(topErr instanceof ClusterTopologyServerNotFoundException)) { + CachePartialUpdateCheckedException cause = X.cause(err, CachePartialUpdateCheckedException.class); - assert !F.isEmpty(cause.failedKeys()); - assert cause != null && cause.topologyVersion() != null : err; ++ assert cause != null && !F.isEmpty(cause.failedKeys()) && cause.topologyVersion() != null : err; - remap(cause.failedKeys()); + remap(cause.failedKeys(), cause.topologyVersion()); - return false; + return false; + } } if (super.onDone(retval, err)) { @@@ -1030,24 -1031,37 +1058,24 @@@ /** * Maps future to single node. * - * @param nodeId Node ID. + * @param mappingKey Mapping key. * @param req Request. */ - private void mapSingle(UUID nodeId, GridNearAtomicUpdateRequest req) { - singleNodeId = nodeId; + private void mapSingle(GridAtomicMappingKey mappingKey, GridNearAtomicUpdateRequest req) { + singleNodeId = mappingKey.nodeId(); singleReq = req; - if (cctx.localNodeId().equals(nodeId)) { - cache.updateAllAsyncInternal(nodeId, req, - new CI2() { - @Override public void apply(GridNearAtomicUpdateRequest req, - GridNearAtomicUpdateResponse res) { - assert res.futureVersion().equals(futVer) : futVer; - - onResult(res.nodeId(), res); - } - }); - } - else { - try { - if (log.isDebugEnabled()) - log.debug("Sending near atomic update request [nodeId=" + req.nodeId() + ", req=" + req + ']'); + try { + if (log.isDebugEnabled()) + log.debug("Sending near atomic update request [nodeId=" + req.nodeId() + ", req=" + req + ']'); - cctx.io().send(req.nodeId(), req, cctx.ioPolicy()); + sendRequest(mappingKey, req); - if (syncMode == FULL_ASYNC && cctx.config().getAtomicWriteOrderMode() == PRIMARY) - onDone(new GridCacheReturn(cctx, true, null, true)); - } - catch (IgniteCheckedException e) { - onDone(addFailedKeys(req.keys(), req.topologyVersion(), e)); - } + if (syncMode == FULL_ASYNC && cctx.config().getAtomicWriteOrderMode() == PRIMARY) + onDone(new GridCacheReturn(cctx, true, null, true)); + } + catch (IgniteCheckedException e) { - onDone(addFailedKeys(req.keys(), e)); ++ onDone(addFailedKeys(req.keys(), req.topologyVersion(), e)); } } @@@ -1056,25 -1070,35 +1084,25 @@@ * * @param mappings Mappings to send. */ - private void doUpdate(Map mappings) { - UUID locNodeId = cctx.localNodeId(); - - GridNearAtomicUpdateRequest locUpdate = null; + private void doUpdate(Map mappings) { + for (Map.Entry e : mappings.entrySet()) { + GridAtomicMappingKey mappingKey = e.getKey(); + GridNearAtomicUpdateRequest req = e.getValue(); - // Send messages to remote nodes first, then run local update. - for (GridNearAtomicUpdateRequest req : mappings.values()) { - if (locNodeId.equals(req.nodeId())) { - assert locUpdate == null : "Cannot have more than one local mapping [locUpdate=" + locUpdate + - ", req=" + req + ']'; + try { + if (log.isDebugEnabled()) + log.debug("Sending near atomic update request [nodeId=" + req.nodeId() + ", req=" + req + ']'); - locUpdate = req; + sendRequest(mappingKey, req); } - else { - try { - if (log.isDebugEnabled()) - log.debug("Sending near atomic update request [nodeId=" + req.nodeId() + ", req=" + req + ']'); - - cctx.io().send(req.nodeId(), req, cctx.ioPolicy()); - } - catch (IgniteCheckedException e) { - addFailedKeys(req.keys(), req.topologyVersion(), e); + catch (IgniteCheckedException ex) { - addFailedKeys(req.keys(), ex); ++ addFailedKeys(req.keys(), req.topologyVersion(), ex); - removeMapping(req.nodeId()); - } - - if (syncMode == PRIMARY_SYNC && !req.hasPrimary()) - removeMapping(req.nodeId()); + removeMapping(mappingKey); } + + if (syncMode == PRIMARY_SYNC && !req.hasPrimary()) + removeMapping(mappingKey); } if (syncMode == FULL_ASYNC)