IGNITE-7699 BinaryMetadata exchange should not be triggered if metadata was not updat...
authorSergey Chugunov <sergey.chugunov@gmail.com>
Fri, 16 Feb 2018 13:21:12 +0000 (16:21 +0300)
committerAlexey Goncharuk <alexey.goncharuk@gmail.com>
Fri, 16 Feb 2018 13:21:12 +0000 (16:21 +0300)
Signed-off-by: Alexey Goncharuk <alexey.goncharuk@gmail.com>
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataTransport.java
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteAllBaselineNodesOnlineFullApiSelfTest.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteBaselineAbstractFullApiSelfTest.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteOfflineBaselineNodeFullApiSelfTest.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteOnlineNodeOutOfBaselineFullApiSelfTest.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteStableBaselineCachePutAllFailoverTest.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteStableBaselineCacheRemoveFailoverTest.java

index e2eef28..9402a32 100644 (file)
@@ -159,7 +159,8 @@ final class BinaryMetadataTransport {
         MetadataUpdateResultFuture resFut = new MetadataUpdateResultFuture();
 
         if (log.isDebugEnabled())
-            log.debug("Requesting metadata update for " + metadata.typeId());
+            log.debug("Requesting metadata update for " + metadata.typeId() + "; caller thread is blocked on future "
+                + resFut);
 
         synchronized (this) {
             unlabeledFutures.add(resFut);
@@ -418,6 +419,9 @@ final class BinaryMetadataTransport {
 
         /** {@inheritDoc} */
         @Override public void onCustomEvent(AffinityTopologyVersion topVer, ClusterNode snd, MetadataUpdateAcceptedMessage msg) {
+            if (log.isDebugEnabled())
+                log.debug("Received MetadataUpdateAcceptedMessage " + msg);
+
             if (msg.duplicated())
                 return;
 
@@ -468,7 +472,7 @@ final class BinaryMetadataTransport {
             GridFutureAdapter<MetadataUpdateResult> fut = syncMap.get(new SyncKey(typeId, newAcceptedVer));
 
             if (log.isDebugEnabled())
-                log.debug("Completing future for " + metaLocCache.get(typeId));
+                log.debug("Completing future " + fut + " for " + metaLocCache.get(typeId));
 
             if (fut != null)
                 fut.onDone(MetadataUpdateResult.createSuccessfulResult());
index 3a0ba3c..a9d2f88 100644 (file)
@@ -442,6 +442,10 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
             BinaryMetadata mergedMeta = BinaryUtils.mergeMetadata(oldMeta, newMeta0);
 
+            //metadata requested to be added is exactly the same as already presented in the cache
+            if (mergedMeta == oldMeta)
+                return;
+
             MetadataUpdateResult res = transport.requestMetadataUpdate(mergedMeta).get();
 
             assert res != null;
index b2de1db..8365f87 100644 (file)
  */
 package org.apache.ignite.internal.processors.cache.persistence.baseline;
 
-import org.apache.ignite.testframework.GridTestUtils;
-
 /**
- *
+ * Full API cache tests when all online nodes in the cluster are in BaselineTopology.
  */
 public class IgniteAllBaselineNodesOnlineFullApiSelfTest extends IgniteBaselineAbstractFullApiSelfTest {
     /** {@inheritDoc} */
index d78c289..1825666 100644 (file)
@@ -23,7 +23,7 @@ import org.apache.ignite.configuration.WALMode;
 import org.apache.ignite.internal.processors.cache.GridCacheAbstractFullApiSelfTest;
 
 /**
- *
+ * Abstract test class for Full API cache tests with presence of BaselineTopology.
  */
 public abstract class IgniteBaselineAbstractFullApiSelfTest extends GridCacheAbstractFullApiSelfTest {
     /** {@inheritDoc} */
index ee4f6b4..2282165 100644 (file)
  */
 package org.apache.ignite.internal.processors.cache.persistence.baseline;
 
-import org.apache.ignite.testframework.GridTestUtils;
-
 /**
- *
+ * Full API cache tests with situation when there is an offline node from BaselineTopology.
  */
 public class IgniteOfflineBaselineNodeFullApiSelfTest extends IgniteBaselineAbstractFullApiSelfTest {
     /** {@inheritDoc} */
index 6cb2b24..3bd8c0f 100644 (file)
@@ -17,7 +17,7 @@
 package org.apache.ignite.internal.processors.cache.persistence.baseline;
 
 /**
- *
+ * Full API cache tests with situation when there is an online node out of BaselineTopology.
  */
 public class IgniteOnlineNodeOutOfBaselineFullApiSelfTest extends IgniteBaselineAbstractFullApiSelfTest {
     /** {@inheritDoc} */
index b89415b..80f3b16 100644 (file)
@@ -28,7 +28,8 @@ import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.testframework.GridTestUtils;
 
 /**
- *
+ * Failover cache test with putAll operations executed with presence of BaselineTopology
+ * when one random node from BLT is constantly restarted during the load.
  */
 public class IgniteStableBaselineCachePutAllFailoverTest extends CachePutAllFailoverAbstractTest {
     /** */
index c07a9d2..e71f33f 100644 (file)
@@ -37,7 +37,8 @@ import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 
 /**
- *
+ * Failover cache test with remove operations executed with presence of BaselineTopology
+ * when one random node from BLT is constantly restarted during the load.
  */
 public class IgniteStableBaselineCacheRemoveFailoverTest extends GridCacheAbstractRemoveFailureTest {
     /** */