ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [2/2] ignite git commit: ignite-5578
Date Tue, 01 Aug 2017 11:21:27 GMT
ignite-5578


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

Branch: refs/heads/ignite-5578-debug
Commit: b3f5a688192fb9128c7f67d953784009e36c35da
Parents: d8ecb99
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Aug 1 14:21:16 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Aug 1 14:21:16 2017 +0300

----------------------------------------------------------------------
 .../affinity/GridAffinityAssignmentCache.java          |  9 +++++++++
 .../internal/processors/cache/GridCacheMapEntry.java   |  9 +++++++++
 .../cache/distributed/dht/GridDhtLocalPartition.java   |  4 ++++
 .../distributed/dht/GridDhtPartitionTopologyImpl.java  | 13 +++++++++++++
 .../dht/preloader/GridDhtPartitionDemander.java        |  4 ++++
 .../dht/preloader/GridDhtPartitionsExchangeFuture.java |  5 +++++
 .../distributed/dht/preloader/GridDhtPreloader.java    |  4 ++++
 ...iteCachePrimaryNodeFailureRecoveryAbstractTest.java | 11 +++++++++++
 8 files changed, 59 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b3f5a688/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
index c60a690..7c99225 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
@@ -32,6 +32,7 @@ import java.util.concurrent.atomic.AtomicReference;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.TestDebugLog;
 import org.apache.ignite.cache.affinity.AffinityCentralizedFunction;
 import org.apache.ignite.cache.affinity.AffinityFunction;
 import org.apache.ignite.cluster.ClusterNode;
@@ -201,6 +202,10 @@ public class GridAffinityAssignmentCache {
             }
         }
 
+        if ("default".equals(cacheOrGrpName)) {
+            TestDebugLog.addPartMessage(6, U.nodeIds(assignment.get(6)), "init " + topVer);
+        }
+
         onHistoryAdded(assignment);
     }
 
@@ -293,6 +298,10 @@ public class GridAffinityAssignmentCache {
             assignment = aff.assignPartitions(new GridAffinityFunctionContextImpl(sorted,
prevAssignment, discoEvt,
                 topVer, backups));
 
+        if ("default".equals(cacheOrGrpName)) {
+            TestDebugLog.addPartMessage(6, U.nodeIds(assignment.get(6)), "calc new " + topVer);
+        }
+
         assert assignment != null;
 
         idealAssignment = assignment;

http://git-wip-us.apache.org/repos/asf/ignite/blob/b3f5a688/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 2a6a109..6764ef6 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
@@ -32,6 +32,7 @@ import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.TestDebugLog;
 import org.apache.ignite.cache.eviction.EvictableEntry;
 import org.apache.ignite.internal.pagemem.wal.StorageException;
 import org.apache.ignite.internal.pagemem.wal.record.DataEntry;
@@ -883,6 +884,8 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
     ) throws IgniteCheckedException, GridCacheEntryRemovedException {
         CacheObject old;
 
+        TestDebugLog.addEntryMessage(key.value(null, false), val.value(cctx.cacheObjectContext(),
false), "innerSet");
+
         boolean valid = valid(tx != null ? tx.topologyVersion() : topVer);
 
         // Lock should be held by now.
@@ -2523,6 +2526,8 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
     ) throws IgniteCheckedException, GridCacheEntryRemovedException {
         ensureFreeSpace();
 
+        TestDebugLog.addEntryMessage(key.value(null, false), val.value(cctx.cacheObjectContext(),
false), "initialVal");
+
         synchronized (this) {
             checkObsolete();
 
@@ -3176,6 +3181,8 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
         assert Thread.holdsLock(this);
         assert val != null : "null values in update for key: " + key;
 
+        TestDebugLog.addEntryMessage(key.value(null, false), val.value(cctx.cacheObjectContext(),
false), "store value");
+
         cctx.offheap().invoke(cctx, key,  localPartition(), new UpdateClosure(this, val,
ver, expireTime));
     }
 
@@ -3218,6 +3225,8 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
     protected void removeValue() throws IgniteCheckedException {
         assert Thread.holdsLock(this);
 
+        TestDebugLog.addEntryMessage(key.value(null, false), val.value(cctx.cacheObjectContext(),
false), "remove value");
+
         cctx.offheap().remove(cctx, key, partition(), localPartition());
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b3f5a688/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 b739bdd..9862ba4 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
@@ -31,6 +31,7 @@ import java.util.concurrent.locks.ReentrantLock;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.TestDebugLog;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.NodeStoppingException;
@@ -558,6 +559,9 @@ public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl
implements
                 boolean update = this.state.compareAndSet(state, setPartState(state, toState));
 
                 if (update)
+                    if (id == 6 && grp.cacheOrGroupName().equals("default"))
+                        TestDebugLog.addPartMessage(6, toState, "set state");
+
                     try {
                         ctx.wal().log(new PartitionMetaStateRecord(grp.groupId(), id, toState,
updateCounter()));
                     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/b3f5a688/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index 0efdf1f..bd03e0c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@ -32,6 +32,7 @@ import java.util.concurrent.atomic.AtomicReferenceArray;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.TestDebugLog;
 import org.apache.ignite.cache.PartitionLossPolicy;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.events.DiscoveryEvent;
@@ -350,6 +351,9 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
 
                             boolean owned = locPart.own();
 
+                            if (p == 6 && grp.cacheOrGroupName().equals("default"))
+                                TestDebugLog.addPartMessage(6, "own start", "owned");
+
                             assert owned : "Failed to own partition for oldest node [grp="
+ grp.cacheOrGroupName() +
                                 ", part=" + locPart + ']';
 
@@ -611,6 +615,9 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
 
                             // If there are no other owners, then become an owner.
                             if (F.isEmpty(owners)) {
+                                if (p == 6 && grp.cacheOrGroupName().equals("default"))
+                                    TestDebugLog.addPartMessage(6, "own after", "owned");
+
                                 boolean owned = locPart.own();
 
                                 assert owned : "Failed to own partition [grp=" + grp.cacheOrGroupName()
+ ", locPart=" +
@@ -1713,6 +1720,9 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
                     GridDhtLocalPartition locPart = localPartition(part, resTopVer, false);
 
                     if (locPart != null) {
+                        if (locPart.id() == 6 && grp.cacheOrGroupName().equals("default"))
+                            TestDebugLog.addPartMessage(6, "detect loss", "owned");
+
                         boolean marked = plc == PartitionLossPolicy.IGNORE ? locPart.own()
: locPart.markLost();
 
                         if (marked)
@@ -1770,6 +1780,9 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
                     if (locPart != null && locPart.state() == LOST) {
                         boolean marked = locPart.own();
 
+                        if (locPart.id() == 6 && grp.cacheOrGroupName().equals("default"))
+                            TestDebugLog.addPartMessage(6, "reset lost", "owned");
+
                         if (marked)
                             updateLocal(locPart.id(), locPart.state(), updSeq, resTopVer);
                     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/b3f5a688/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
index 248b739..44e0c5d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
@@ -30,6 +30,7 @@ import java.util.UUID;
 import java.util.concurrent.atomic.AtomicReference;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.TestDebugLog;
 import org.apache.ignite.cache.CacheRebalanceMode;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.CacheConfiguration;
@@ -683,6 +684,9 @@ public class GridDhtPartitionDemander {
                                 if (supply.isClean(p))
                                     part.updateCounter(supply.last().get(p));
 
+                                if (p == 6 && grp.cacheOrGroupName().equals("default"))
+                                    TestDebugLog.addPartMessage(6, "last supply", "owned");
+
                                 top.own(part);
 
                                 fut.partitionDone(id, p);

http://git-wip-us.apache.org/repos/asf/ignite/blob/b3f5a688/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 d04974a..becaa15 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
@@ -38,6 +38,7 @@ import java.util.concurrent.locks.ReadWriteLock;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.IgniteSystemProperties;
+import org.apache.ignite.TestDebugLog;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.NearCacheConfiguration;
 import org.apache.ignite.events.DiscoveryEvent;
@@ -513,6 +514,8 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
 
         U.await(evtLatch);
 
+        TestDebugLog.addMessage("init " + initialVersion());
+
         assert discoEvt != null : this;
         assert exchId.nodeId().equals(discoEvt.eventNode().id()) : this;
 
@@ -1347,6 +1350,8 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
         if (!done.compareAndSet(false, true))
             return false;
 
+        TestDebugLog.addMessage("done " + initialVersion() + " " + res);
+
         log.info("Finish exchange future [startVer=" + initialVersion() +
             ", resVer=" + res +
             ", err=" + err + ']');

http://git-wip-us.apache.org/repos/asf/ignite/blob/b3f5a688/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 11d9c77..5799789 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
@@ -28,6 +28,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.TestDebugLog;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.internal.IgniteFutureTimeoutCheckedException;
 import org.apache.ignite.internal.IgniteInternalFuture;
@@ -289,6 +290,9 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
                     Collection<ClusterNode> picked = pickedOwners(p, topVer);
 
                     if (picked.isEmpty()) {
+                        if (p == 6 && grp.cacheOrGroupName().equals("default"))
+                            TestDebugLog.addPartMessage(6, "no picked", "owned");
+
                         top.own(part);
 
                         if (grp.eventRecordable(EVT_CACHE_REBALANCE_PART_DATA_LOST)) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/b3f5a688/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePrimaryNodeFailureRecoveryAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePrimaryNodeFailureRecoveryAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePrimaryNodeFailureRecoveryAbstractTest.java
index 0d0cda4..ea46fb6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePrimaryNodeFailureRecoveryAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePrimaryNodeFailureRecoveryAbstractTest.java
@@ -27,6 +27,7 @@ import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteIllegalStateException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.IgniteTransactions;
+import org.apache.ignite.TestDebugLog;
 import org.apache.ignite.cache.CacheAtomicityMode;
 import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.cache.affinity.Affinity;
@@ -368,6 +369,8 @@ public abstract class IgniteCachePrimaryNodeFailureRecoveryAbstractTest
extends
 
         log.info("Put key2 [key2=" + key2 + ", nodes=" + U.nodeIds(aff.mapKeyToPrimaryAndBackups(key2))
+ ']');
 
+        log.info("part: " + aff.partition(key2));
+
         cache0.put(key2, key2);
 
         log.info("Start prepare.");
@@ -456,6 +459,14 @@ public abstract class IgniteCachePrimaryNodeFailureRecoveryAbstractTest
extends
             for (Ignite ignite : G.allGrids()) {
                 IgniteCache<Integer, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME);
 
+                if (cache.get(key) == null) {
+                    TestDebugLog.addMessage("No value " + key + " " + ignite.name());
+
+                    TestDebugLog.printMessages(true, 6);
+
+                    System.exit(1);
+                }
+
                 assertEquals("Unexpected value for: " + ignite.name(), key, cache.get(key));
             }
         }


Mime
View raw message