IGNITE-10591: MVCC: Incorrect data region metrics. This closes #5690.
authorAndrey V. Mashenkov <andrey.mashenkov@gmail.com>
Mon, 14 Jan 2019 11:49:56 +0000 (14:49 +0300)
committerIgor Seliverstov <gvvinblade@gmail.com>
Mon, 14 Jan 2019 11:49:56 +0000 (14:49 +0300)
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgnitePdsDataRegionMetricsTxTest.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsDataRegionMetricsTest.java

index 0085d2e..09b1213 100644 (file)
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.cache.CacheAtomicityMode;
 import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.processors.cache.persistence.db.IgnitePdsDataRegionMetricsTest;
 import org.apache.ignite.testframework.MvccFeatureChecker;
 import org.junit.Ignore;
@@ -32,17 +33,14 @@ import org.junit.runners.JUnit4;
 @RunWith(JUnit4.class)
 public class IgnitePdsDataRegionMetricsTxTest extends IgnitePdsDataRegionMetricsTest {
     /** {@inheritDoc} */
-    @Override protected CacheConfiguration<Object, Object> cacheConfiguration() {
-        return super.cacheConfiguration().setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
+    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+        return super.getConfiguration(igniteInstanceName)
+            .setMvccVacuumFrequency(Long.MAX_VALUE);
     }
 
     /** {@inheritDoc} */
-    @Test
-    @Override public void testMemoryUsageSingleNode() throws Exception {
-        if (MvccFeatureChecker.forcedMvcc())
-            fail("https://issues.apache.org/jira/browse/IGNITE-10591");
-
-        super.testMemoryUsageSingleNode();
+    @Override protected CacheConfiguration<Object, Object> cacheConfiguration() {
+        return super.cacheConfiguration().setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
     }
 
     /** {@inheritDoc} */
index 030edcc..5dc8013 100644 (file)
@@ -54,6 +54,7 @@ import org.junit.runners.JUnit4;
 import static java.nio.file.Files.newDirectoryStream;
 import static org.apache.ignite.configuration.DataStorageConfiguration.DFLT_DATA_REG_DEFAULT_NAME;
 import static org.apache.ignite.internal.processors.cache.GridCacheUtils.UTILITY_CACHE_NAME;
+import static org.apache.ignite.internal.processors.cache.mvcc.txlog.TxLog.TX_LOG_CACHE_NAME;
 import static org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.META_STORAGE_NAME;
 import static org.apache.ignite.internal.processors.cache.persistence.metastorage.MetaStorage.METASTORAGE_CACHE_ID;
 import static org.apache.ignite.internal.processors.cache.persistence.metastorage.MetaStorage.METASTORAGE_CACHE_NAME;
@@ -157,7 +158,7 @@ public class IgnitePdsDataRegionMetricsTest extends GridCommonAbstractTest {
 
                 cache.putAll(map);
 
-                forceCheckpoint();
+                forceCheckpoint(node);
 
                 checkMetricsConsistency(node);
             }
@@ -311,6 +312,7 @@ public class IgnitePdsDataRegionMetricsTest extends GridCommonAbstractTest {
     private void checkMetricsConsistency(final IgniteEx node) throws Exception {
         checkMetricsConsistency(node, DEFAULT_CACHE_NAME);
         checkMetricsConsistency(node, UTILITY_CACHE_NAME);
+        checkMetricsConsistency(node, TX_LOG_CACHE_NAME);
         checkMetricsConsistency(node, METASTORAGE_CACHE_NAME);
     }
 
@@ -321,8 +323,10 @@ public class IgnitePdsDataRegionMetricsTest extends GridCommonAbstractTest {
         assert pageStoreMgr != null : "Persistence is not enabled";
 
         boolean metaStore = METASTORAGE_CACHE_NAME.equals(cacheName);
+        boolean txLog = TX_LOG_CACHE_NAME.equals(cacheName);
 
         File cacheWorkDir = metaStore ? new File(pageStoreMgr.workDir(), META_STORAGE_NAME) :
+            txLog ? new File(pageStoreMgr.workDir(), TX_LOG_CACHE_NAME) :
             pageStoreMgr.cacheWorkDir(node.cachex(cacheName).configuration());
 
         long totalPersistenceSize = 0;
@@ -349,6 +353,7 @@ public class IgnitePdsDataRegionMetricsTest extends GridCommonAbstractTest {
         GridCacheSharedContext cctx = node.context().cache().context();
 
         String regionName = metaStore ? GridCacheDatabaseSharedManager.METASTORE_DATA_REGION_NAME :
+            txLog ? TX_LOG_CACHE_NAME :
             cctx.cacheContext(CU.cacheId(cacheName)).group().dataRegion().config().getName();
 
         long totalAllocatedPagesFromMetrics = cctx.database().memoryMetrics(regionName).getTotalAllocatedPages();