ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/4] ignite git commit: ignite-4705
Date Tue, 07 Mar 2017 10:33:55 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-4705-debug [created] b1992a92b


ignite-4705


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a53cfeb0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a53cfeb0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a53cfeb0

Branch: refs/heads/ignite-4705-debug
Commit: a53cfeb0c31d7174947b1fe6ec5403e8ed637319
Parents: 25f2ced
Author: sboikov <sboikov@gridgain.com>
Authored: Mon Mar 6 16:48:40 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Mon Mar 6 16:48:40 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     |  7 +++++
 .../dht/atomic/GridDhtAtomicCache.java          |  6 +++++
 .../GridNearAtomicAbstractUpdateFuture.java     |  6 +++++
 .../GridNearAtomicCheckUpdateRequest.java       | 13 ++++++++-
 .../GridNearAtomicSingleUpdateFuture.java       | 23 +++++++++++++---
 .../IgniteCachePutRetryAbstractSelfTest.java    | 28 ++++++++++++++++++--
 .../dht/IgniteCachePutRetryAtomicSelfTest.java  |  2 +-
 .../IgniteCacheFailoverTestSuite3.java          |  4 +--
 8 files changed, 79 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a53cfeb0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 6124864..ca11e84 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -44,6 +44,7 @@ import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheEntry;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
 import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicAbstractUpdateFuture;
+import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.TestDebugLog;
 import org.apache.ignite.internal.processors.cache.distributed.near.GridNearCacheEntry;
 import org.apache.ignite.internal.processors.cache.extras.GridCacheEntryExtras;
 import org.apache.ignite.internal.processors.cache.extras.GridCacheMvccEntryExtras;
@@ -2038,6 +2039,8 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
         Long updateCntr0 = null;
 
         synchronized (this) {
+            TestDebugLog.addKeyMessage(key, ((CacheObject)writeObj).value(cctx.cacheObjectContext(),
false), "innerUpdate");
+
             boolean internal = isInternal() || !context().userCache();
 
             Map<UUID, CacheContinuousQueryListener> lsnrs = cctx.continuousQueries().updateListeners(internal,
false);
@@ -2277,6 +2280,8 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
                                 topVer);
                         }
 
+                        TestDebugLog.addKeyMessage(key, ((CacheObject)writeObj).value(cctx.cacheObjectContext(),
false), "ver check failed");
+
                         return new GridCacheUpdateAtomicResult(false,
                             retval ? rawGetOrUnmarshalUnlocked(false) : null,
                             null,
@@ -3485,6 +3490,8 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
             checkObsolete();
 
             if ((isNew() && !cctx.swap().containsKey(key, partition())) || (!preload
&& deletedUnlocked())) {
+                TestDebugLog.addKeyMessage(key, val.value(cctx.cacheObjectContext(), false),
"rebalance");
+
                 long expTime = expireTime < 0 ? CU.toExpireTime(ttl) : expireTime;
 
                 val = cctx.kernalContext().cacheObjects().prepareForCache(val, cctx);

http://git-wip-us.apache.org/repos/asf/ignite/blob/a53cfeb0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 5af82b3..d690737 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -1727,6 +1727,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
         GridNearAtomicAbstractUpdateRequest req,
         UpdateReplyClosure completionCb
     ) {
+        TestDebugLog.addKeyMessage(req.key(0), req.topologyVersion(), "req, on primary");
+
         ClusterNode node = ctx.discovery().node(nodeId);
 
         if (node == null) {
@@ -1906,6 +1908,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
         }
 
         if (remap) {
+            TestDebugLog.addKeyMessage(req.key(0), res.remapTopologyVersion(), "primary,
need remap");
+
             assert dhtFut == null;
 
             completionCb.apply(req, res);
@@ -3085,6 +3089,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
             checkReq.futureId(),
             false);
 
+        res.partition(checkReq.partition());
+
         GridCacheReturn ret = new GridCacheReturn(false, true);
 
         res.returnValue(ret);

http://git-wip-us.apache.org/repos/asf/ignite/blob/a53cfeb0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
index f0c50c2..7c70b96 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
@@ -214,6 +214,8 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
 
     void sendCheckUpdateRequest(GridNearAtomicCheckUpdateRequest req) {
         try {
+            TestDebugLog.addEntryMessage(req.updateRequest().key(0), req.updateRequest().nodeId(),
"send primary check");
+
             cctx.io().send(req.updateRequest().nodeId(), req, cctx.ioPolicy());
         }
         catch (ClusterTopologyCheckedException e) {
@@ -329,6 +331,8 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
     public abstract void onDhtResponse(UUID nodeId, GridDhtAtomicNearResponse res);
 
     final void onPrimaryError(GridNearAtomicAbstractUpdateRequest req, GridNearAtomicUpdateResponse
res) {
+        TestDebugLog.addEntryMessage(req.key(0), req.nodeId(), "primary err");
+
         assert res.error() != null;
 
         if (err == null)
@@ -476,6 +480,8 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
                 UUID nodeId = it.next();
 
                 if (!cctx.discovery().alive(nodeId)) {
+                    TestDebugLog.addEntryMessage(req.key(0), nodeId, "check dht alive, found
left");
+
                     it.remove();
 
                     if (finished()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/a53cfeb0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicCheckUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicCheckUpdateRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicCheckUpdateRequest.java
index a30269b..890ef67 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicCheckUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicCheckUpdateRequest.java
@@ -51,19 +51,30 @@ public class GridNearAtomicCheckUpdateRequest extends GridCacheMessage
{
         // No-op.
     }
 
+    /**
+     * @param updateReq Related update request.
+     */
     GridNearAtomicCheckUpdateRequest(GridNearAtomicAbstractUpdateRequest updateReq) {
-        assert updateReq != null;
+        assert updateReq != null && updateReq.fullSync() : updateReq;
 
         this.updateReq = updateReq;
         this.cacheId = updateReq.cacheId();
         this.partId = updateReq.partition();
         this.futId = updateReq.futureId();
+
+        assert partId >= 0;
     }
 
+    /**
+     * @return Future ID on near node.
+     */
     long futureId() {
         return futId;
     }
 
+    /**
+     * @return Related update request.
+     */
     GridNearAtomicAbstractUpdateRequest updateRequest() {
         return updateReq;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/a53cfeb0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
index cb013f7..fa3fa71 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
@@ -148,6 +148,8 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
             if (reqState.req.nodeId.equals(nodeId)) {
                 GridNearAtomicAbstractUpdateRequest req = reqState.processPrimaryResponse(nodeId);
 
+                TestDebugLog.addEntryMessage(key, nodeId, "node left, primary");
+
                 if (req != null) {
                     GridNearAtomicUpdateResponse res = primaryFailedResponse(req);
 
@@ -161,6 +163,8 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
             else {
                 DhtLeftResult res = reqState.onDhtNodeLeft(nodeId);
 
+                TestDebugLog.addEntryMessage(key, res, "node left, dht check");
+
                 if (res == DhtLeftResult.DONE)
                     rcvAll = true;
                 else if (res == DhtLeftResult.ALL_RCVD_CHECK_PRIMARY)
@@ -200,6 +204,8 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
         if (super.onDone(retval, err)) {
             Long futVer = onFutureDone();
 
+            TestDebugLog.addEntryMessage(key, futVer, "fut done");
+
             if (futVer != null)
                 cctx.mvcc().removeAtomicFuture(futVer);
 
@@ -225,6 +231,8 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
             if (opRes == null && res.hasResult())
                 opRes = res.result();
 
+            TestDebugLog.addEntryMessage(key, nodeId, "dht res");
+
             if (reqState.onDhtResponse(nodeId, res)) {
                 opRes0 = opRes;
                 err0 = err;
@@ -248,7 +256,6 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
     }
 
     /** {@inheritDoc} */
-    @SuppressWarnings({"unchecked", "ThrowableResultOfMethodCallIgnored"})
     @Override public void onPrimaryResponse(UUID nodeId, GridNearAtomicUpdateResponse res,
boolean nodeErr) {
         GridNearAtomicAbstractUpdateRequest req;
 
@@ -269,6 +276,8 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
             boolean remapKey = res.remapTopologyVersion() != null;
 
             if (remapKey) {
+                TestDebugLog.addEntryMessage(key, nodeId, "remap " + res.remapTopologyVersion());
+
                 assert !req.topologyVersion().equals(res.remapTopologyVersion());
 
                 assert remapTopVer == null : remapTopVer;
@@ -297,6 +306,8 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
 
                 assert reqState != null;
 
+                TestDebugLog.addEntryMessage(key, nodeId, "primary res");
+
                 if (!reqState.onPrimaryResponse(res, cctx))
                     return;
             }
@@ -315,15 +326,15 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
             return;
         }
 
-        if (nearEnabled && !nodeErr)
-            updateNear(req, res);
-
         if (remapTopVer0 != null) {
             waitAndRemap(remapTopVer0);
 
             return;
         }
 
+        if (nearEnabled && !nodeErr)
+            updateNear(req, res);
+
         onDone(opRes0, err0);
     }
 
@@ -356,6 +367,8 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
             remapTopVer0 = remapTopVer;
 
         if (remapTopVer0 != null) {
+            TestDebugLog.addEntryMessage(key, remapTopVer0, "all rcvd, remap");
+
             cctx.mvcc().removeAtomicFuture(futId);
 
             reqState = null;
@@ -610,6 +623,8 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
 
         boolean needPrimaryRes = !mappingKnown || primary.isLocal() || nodes.size() == 1;
 
+        TestDebugLog.addEntryMessage(key, primary.id(), "mapped");
+
         GridNearAtomicAbstractUpdateRequest req;
 
         if (canUseSingleRequest()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/a53cfeb0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
index 096d631..206a744 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
@@ -45,6 +45,7 @@ import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.IgniteKernal;
 import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
+import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.TestDebugLog;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager;
 import org.apache.ignite.internal.util.lang.GridAbsPredicate;
 import org.apache.ignite.internal.util.typedef.X;
@@ -244,6 +245,9 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCommonAbst
      * @throws Exception If failed.
      */
     protected final void checkRetry(Test test, TestMemoryMode memMode, boolean store) throws
Exception {
+        if (test != Test.PUT)
+            return;
+
         ignite(0).createCache(cacheConfiguration(memMode, store));
 
         final AtomicBoolean finished = new AtomicBoolean();
@@ -255,10 +259,14 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCommonAbst
                 Random rnd = new Random();
 
                 while (!finished.get()) {
+                    TestDebugLog.addMessage("stop node " + grid(3).cluster().localNode().id());
+
                     stopGrid(3);
 
                     U.sleep(300);
 
+                    TestDebugLog.addMessage("start node " + getTestGridName(3));
+
                     startGrid(3);
 
                     if (rnd.nextBoolean()) // OPC possible only when there is no migration
from one backup to another.
@@ -286,11 +294,27 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCommonAbst
                     while (System.currentTimeMillis() < stopTime) {
                         Integer val = ++iter;
 
-                        for (int i = 0; i < keysCnt; i++)
+                        for (int i = 0; i < keysCnt; i++) {
+                            TestDebugLog.addEntryMessage(i, val, "start put");
+
                             cache.put(i, val);
 
-                        for (int i = 0; i < keysCnt; i++)
+                            TestDebugLog.addEntryMessage(i, val, "end put");
+                        }
+
+                        for (int i = 0; i < keysCnt; i++) {
+                            if (!val.equals(cache.get(i))) {
+                                TestDebugLog.addEntryMessage(i, val, "wrong val");
+
+                                TestDebugLog.printKeyMessages("test_debug.txt", i);
+
+                                System.exit(33);
+                            }
+
                             assertEquals(val, cache.get(i));
+                        }
+
+                        TestDebugLog.clear();
                     }
 
                     break;

http://git-wip-us.apache.org/repos/asf/ignite/blob/a53cfeb0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAtomicSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAtomicSelfTest.java
index 3d7c7d7..a4f5035 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAtomicSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAtomicSelfTest.java
@@ -46,7 +46,7 @@ public class IgniteCachePutRetryAtomicSelfTest extends IgniteCachePutRetryAbstra
     /**
      * @throws Exception If failed.
      */
-    public void testPutInsideTransaction() throws Exception {
+    public void _testPutInsideTransaction() throws Exception {
         ignite(0).createCache(cacheConfiguration(GridTestUtils.TestMemoryMode.HEAP, false));
 
         CacheConfiguration<Integer, Integer> ccfg = new CacheConfiguration<>();

http://git-wip-us.apache.org/repos/asf/ignite/blob/a53cfeb0/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java
index 85b6e93..d754585 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java
@@ -36,8 +36,8 @@ public class IgniteCacheFailoverTestSuite3 extends TestSuite {
 
         suite.addTestSuite(IgniteCachePutRetryAtomicSelfTest.class);
         suite.addTestSuite(IgniteCachePutRetryAtomicPrimaryWriteOrderSelfTest.class);
-        suite.addTestSuite(IgniteCachePutRetryTransactionalSelfTest.class);
-        suite.addTestSuite(CacheGetInsideLockChangingTopologyTest.class);
+//        suite.addTestSuite(IgniteCachePutRetryTransactionalSelfTest.class);
+//        suite.addTestSuite(CacheGetInsideLockChangingTopologyTest.class);
 
         return suite;
     }


Mime
View raw message