ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-5075
Date Fri, 12 May 2017 11:07:04 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-5075 b53950ac9 -> 542c2c906


ignite-5075


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

Branch: refs/heads/ignite-5075
Commit: 542c2c906ac6b2f7b160ba694dd4422f62cb743d
Parents: b53950a
Author: sboikov <sboikov@gridgain.com>
Authored: Fri May 12 13:21:56 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri May 12 14:06:57 2017 +0300

----------------------------------------------------------------------
 .../cache/CacheAffinitySharedManager.java       | 13 ++++++------
 .../cache/CacheGroupInfrastructure.java         |  4 ++--
 .../processors/cache/GridCacheProcessor.java    |  2 +-
 .../dht/GridDhtPartitionTopologyImpl.java       | 22 ++++++++++----------
 .../processors/cache/IgniteCacheGroupsTest.java | 13 ++++++++++++
 5 files changed, 34 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/542c2c90/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
index d9c6071..c3fc575 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
@@ -398,8 +398,8 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
         }
 
         if (crd) {
-            for (CacheGroupDescriptor grpDesc : exchActions.cacheGroupsToStart())
-                initStartedGroupOnCoordinator(fut, grpDesc);
+            for (ExchangeActions.ActionData action : exchActions.newAndClientCachesStartRequests())
+                initStartedGroupOnCoordinator(fut, action.descriptor().groupDescriptor());
         }
 
         List<ExchangeActions.ActionData> closeReqs = exchActions.closeRequests(cctx.localNodeId());
@@ -434,7 +434,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
                 else
                     grpClosed = true;
 
-                // All client caches were stopped, need create 'client' CacheGroupHolder.
+                // All client cache groups were stopped, need create 'client' CacheGroupHolder.
                 if (grpClosed) {
                     CacheGroupHolder grpHolder = grpHolders.remove(grp.groupId());
 
@@ -754,8 +754,8 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
      */
     private void forAllCacheGroups(boolean crd, IgniteInClosureX<GridAffinityAssignmentCache>
c) {
         if (crd) {
-            for (CacheGroupHolder cache : grpHolders.values())
-                c.apply(cache.affinity());
+            for (CacheGroupHolder grp : grpHolders.values())
+                c.apply(grp.affinity());
         }
         else {
             for (CacheGroupInfrastructure grp : cctx.kernalContext().cache().cacheGroups())
{
@@ -1128,12 +1128,13 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
                 CacheGroupHolder grpHolder = grpHolders.get(desc.groupId());
 
                 if (grpHolder != null) {
-                    if (grpHolder.client())
+                    if (grpHolder.client()) // Affinity for non-client holders calculated
in {@link #onServerLeft}.
                         grpHolder.affinity().calculate(fut.topologyVersion(), fut.discoveryEvent(),
fut.discoCache());
 
                     return;
                 }
 
+                // Need initialize holders and affinity if this node became coordinator during
this exchange.
                 final Integer grpId = desc.groupId();
 
                 CacheGroupInfrastructure grp = cctx.cache().cacheGroup(grpId);

http://git-wip-us.apache.org/repos/asf/ignite/blob/542c2c90/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupInfrastructure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupInfrastructure.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupInfrastructure.java
index 94d4357..ec33685 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupInfrastructure.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupInfrastructure.java
@@ -332,9 +332,9 @@ public class CacheGroupInfrastructure {
      */
     @Nullable public String nameForLog() {
         if (ccfg.getGroupName() == null)
-            return "Cache-" + ccfg.getName();
+            return "[cache, name=" + ccfg.getName() + ']';
 
-        return "CacheGroup-" + ccfg.getGroupName();
+        return "[cacheGroup, name=" + ccfg.getGroupName() + ']';
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/542c2c90/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 6abe09f..776f2c8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -970,7 +970,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                 stopCache(cache, cancel, false);
         }
 
-        for (CacheGroupInfrastructure grp :cacheGrps.values())
+        for (CacheGroupInfrastructure grp : cacheGrps.values())
             stopCacheGroup(grp.groupId());
 
         cachesInfo.clearCaches();

http://git-wip-us.apache.org/repos/asf/ignite/blob/542c2c90/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 770c791..826b2d4 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
@@ -243,7 +243,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
                             if (dumpCnt++ < GridDhtPartitionsExchangeFuture.DUMP_PENDING_OBJECTS_THRESHOLD)
{
                                 U.warn(log, "Failed to wait for partition eviction [" +
                                     "topVer=" + topVer +
-                                    ", group=" + grp.name() +
+                                    ", group=" + grp.nameForLog() +
                                     ", part=" + part.id() +
                                     ", partState=" + part.state() +
                                     ", size=" + part.size() +
@@ -337,7 +337,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
         AffinityTopologyVersion topVer = this.topVer;
 
         assert topVer.topologyVersion() > 0 : "Invalid topology version [topVer=" + topVer
+
-            ", group=" + grp.name() + ']';
+            ", group=" + grp.nameForLog() + ']';
 
         return topVer;
     }
@@ -387,12 +387,12 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
 
         assert topVer.equals(exchFut.topologyVersion()) :
             "Invalid topology [topVer=" + topVer +
-                ", grp=" + grp.name() +
+                ", grp=" + grp.nameForLog() +
                 ", futVer=" + exchFut.topologyVersion() +
                 ", fut=" + exchFut + ']';
         assert grp.affinity().lastVersion().equals(exchFut.topologyVersion()) :
             "Invalid affinity [topVer=" + grp.affinity().lastVersion() +
-                ", grp=" + grp.name() +
+                ", grp=" + grp.nameForLog() +
                 ", futVer=" + exchFut.topologyVersion() +
                 ", fut=" + exchFut + ']';
 
@@ -414,7 +414,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
 
                         boolean owned = locPart.own();
 
-                        assert owned : "Failed to own partition for oldest node [grp=" +
grp.name() +
+                        assert owned : "Failed to own partition for oldest node [grp=" +
grp.nameForLog() +
                             ", part=" + locPart + ']';
 
                         if (log.isDebugEnabled())
@@ -654,7 +654,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
                             if (F.isEmpty(owners)) {
                                 boolean owned = locPart.own();
 
-                                assert owned : "Failed to own partition [grp=" + grp.name()
+ ", locPart=" +
+                                assert owned : "Failed to own partition [grp=" + grp.nameForLog()
+ ", locPart=" +
                                     locPart + ']';
 
                                 updateSeq = updateLocal(p, locPart.state(), updateSeq);
@@ -960,7 +960,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
             assert node2part != null && node2part.valid() : "Invalid node-to-partitions
map [topVer1=" + topVer +
                 ", topVer2=" + this.topVer +
                 ", node=" + ctx.igniteInstanceName() +
-                ", grp=" + grp.name() +
+                ", grp=" + grp.nameForLog() +
                 ", node2part=" + node2part + ']';
 
             List<ClusterNode> nodes = null;
@@ -1015,7 +1015,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
             assert node2part != null && node2part.valid() : "Invalid node-to-partitions
map [topVer=" + topVer +
                 ", allIds=" + allIds +
                 ", node2part=" + node2part +
-                ", grp=" + grp.name() + ']';
+                ", grp=" + grp.nameForLog() + ']';
 
             Collection<UUID> nodeIds = part2node.get(p);
 
@@ -1942,7 +1942,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
 
         try {
             assert node2part != null && node2part.valid() : "Invalid node2part [node2part:
" + node2part +
-                ", grp=" + grp.name() +
+                ", grp=" + grp.nameForLog() +
                 ", stopping=" + stopping +
                 ", locNodeId=" + ctx.localNodeId() +
                 ", locName=" + ctx.igniteInstanceName() + ']';
@@ -1962,7 +1962,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
     /** {@inheritDoc} */
     @Override public void printMemoryStats(int threshold) {
         X.println(">>>  Cache partition topology stats [igniteInstanceName=" + ctx.igniteInstanceName()
+
-            ", grp=" + grp.name() + ']');
+            ", grp=" + grp.nameForLog() + ']');
 
         lock.readLock().lock();
 
@@ -2017,7 +2017,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
             rebalancedTopVer = topVer;
 
             if (log.isDebugEnabled())
-                log.debug("Updated rebalanced version [cache=" + grp.name() + ", ver=" +
rebalancedTopVer + ']');
+                log.debug("Updated rebalanced version [cache=" + grp.nameForLog() + ", ver="
+ rebalancedTopVer + ']');
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/542c2c90/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
index 4ba4cfe..39dc044 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
@@ -89,10 +89,23 @@ public class IgniteCacheGroupsTest extends GridCommonAbstractTest {
         checkCacheGroup(0, GROUP1, true);
         checkCacheGroup(0, GROUP1, true);
 
+        checkCache(0, "c1");
+        checkCache(1, "c1");
+
         c1.close();
 
         checkCacheGroup(0, GROUP1, true);
         checkCacheGroup(1, GROUP1, false);
+
+        checkCache(0, "c1");
+
+        assertNotNull(client.cache("c1"));
+
+        checkCacheGroup(0, GROUP1, true);
+        checkCacheGroup(1, GROUP1, true);
+
+        checkCache(0, "c1");
+        checkCache(1, "c1");
     }
 
     /**


Mime
View raw message