You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2018/11/20 20:43:30 UTC

[1/8] ignite git commit: IGNITE-9999 Added verbose logging for node recovery (fixed NPE)

Repository: ignite
Updated Branches:
  refs/heads/ignite-10044 763ea3253 -> 1a60eafc9


IGNITE-9999 Added verbose logging for node recovery (fixed NPE)


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

Branch: refs/heads/ignite-10044
Commit: d6d4965fd86d8177903abf0ccf9a7e8ac77917a0
Parents: 8c08de7
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Tue Nov 20 19:09:10 2018 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Nov 20 19:09:10 2018 +0300

----------------------------------------------------------------------
 .../cache/persistence/wal/serializer/RecordDataV1Serializer.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d6d4965f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/serializer/RecordDataV1Serializer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/serializer/RecordDataV1Serializer.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/serializer/RecordDataV1Serializer.java
index 926e403..ab35f46 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/serializer/RecordDataV1Serializer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/serializer/RecordDataV1Serializer.java
@@ -244,7 +244,9 @@ public class RecordDataV1Serializer implements RecordDataSerializer {
         if (encSpi instanceof NoopEncryptionSpi)
             return false;
 
-        return encMgr.groupKey(grpId) != null;
+        GridEncryptionManager encMgr = cctx.kernalContext().encryption();
+
+        return encMgr != null && encMgr.groupKey(grpId) != null;
     }
 
     /**


[2/8] ignite git commit: IGNITE-10349 Web Console: Added check for supported MongoDb version.

Posted by sb...@apache.org.
IGNITE-10349 Web Console: Added check for supported MongoDb version.


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

Branch: refs/heads/ignite-10044
Commit: 8bd59ccfff778ba59d55707c5182c09e391c0103
Parents: d6d4965
Author: Vasiliy Sisko <vs...@gridgain.com>
Authored: Tue Nov 20 23:56:22 2018 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Nov 20 23:56:22 2018 +0700

----------------------------------------------------------------------
 modules/web-console/backend/index.js        | 10 +++++-----
 modules/web-console/backend/launch-tools.js | 20 +++++++++++++++++++-
 2 files changed, 24 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8bd59ccf/modules/web-console/backend/index.js
----------------------------------------------------------------------
diff --git a/modules/web-console/backend/index.js b/modules/web-console/backend/index.js
index 4697de9..c601c0b 100644
--- a/modules/web-console/backend/index.js
+++ b/modules/web-console/backend/index.js
@@ -23,17 +23,17 @@ const appPath = require('app-module-path');
 appPath.addPath(__dirname);
 appPath.addPath(path.join(__dirname, 'node_modules'));
 
-const { migrate, init } = require('./launch-tools');
+const { checkMongo, migrate, init } = require('./launch-tools');
 
 const injector = require('./injector');
 
 injector.log.info = () => {};
 injector.log.debug = () => {};
 
-Promise.all([injector('settings'), injector('mongo')])
-    .then(([{mongoUrl}]) => {
-        return migrate(mongoUrl, 'Ignite', path.join(__dirname, 'migrations'));
-    })
+injector('mongo')
+    .then(() => checkMongo())
+    .then(() => injector('settings'))
+    .then(({mongoUrl}) => migrate(mongoUrl, 'Ignite', path.join(__dirname, 'migrations')))
     .then(() => Promise.all([injector('settings'), injector('api-server'), injector('agents-handler'), injector('browsers-handler')]))
     .then(init)
     .catch((err) => {

http://git-wip-us.apache.org/repos/asf/ignite/blob/8bd59ccf/modules/web-console/backend/launch-tools.js
----------------------------------------------------------------------
diff --git a/modules/web-console/backend/launch-tools.js b/modules/web-console/backend/launch-tools.js
index f1f3b2f..3870b0d 100644
--- a/modules/web-console/backend/launch-tools.js
+++ b/modules/web-console/backend/launch-tools.js
@@ -21,6 +21,7 @@ const _ = require('lodash');
 const http = require('http');
 const https = require('https');
 const MigrateMongoose = require('migrate-mongoose');
+const mongoose = require('mongoose');
 
 /**
  * Event listener for HTTP server "error" event.
@@ -106,4 +107,21 @@ const migrate = (dbConnectionUri, group, migrationsPath, collectionName) => {
         });
 };
 
-module.exports = { migrate, init };
+/**
+ * Check version of used MongoDB.
+ */
+const checkMongo = () => {
+    const versionValid = (mijor, minor) => mijor === 3 && minor >= 2 && minor <= 4;
+
+    const admin = new mongoose.mongo.Admin(mongoose.connection.db, null, global.Promise);
+
+    return admin.buildInfo()
+        .then((info) => {
+            const versions = info.version.split('.');
+
+            if (!versionValid(parseInt(versions[0]), parseInt(versions[1])))
+                throw Error(`Unsupported version of MongoDB ${info.version}. Supported versions: 3.2.x-3.4.x`);
+        });
+};
+
+module.exports = { checkMongo, migrate, init };


[4/8] ignite git commit: IGNITE-9959 Set consistent ID in tests - Fixes #5046

Posted by sb...@apache.org.
IGNITE-9959 Set consistent ID in tests - Fixes #5046


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

Branch: refs/heads/ignite-10044
Commit: e2778462b4be754cd99596184c1da0db6a730aa6
Parents: 296737a
Author: Alexey Platonov <ap...@gmail.com>
Authored: Tue Nov 20 20:36:34 2018 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Nov 20 20:36:34 2018 +0300

----------------------------------------------------------------------
 .../jdbc2/JdbcDistributedJoinsQueryTest.java    |  4 +++
 ...tingToWalV2SerializerWithCompactionTest.java |  5 ++++
 .../PersistenceBasicCompatibilityTest.java      |  5 ++++
 .../cache/GridCacheAbstractMetricsSelfTest.java |  6 +++++
 ...tePdsBinaryMetadataOnClusterRestartTest.java |  4 +--
 .../IgniteUidAsConsistentIdMigrationTest.java   | 26 ++++++++++++++------
 .../db/wal/reader/IgniteWalReaderTest.java      |  9 ++++---
 ...teCacheContinuousQueryNoUnsubscribeTest.java |  5 ++++
 .../testframework/junits/GridAbstractTest.java  | 20 +++++++++++++++
 .../IgniteBinaryObjectFieldsQuerySelfTest.java  |  5 ++++
 .../db/wal/IgniteWalRecoveryTest.java           |  3 +--
 ...IgniteSqlSkipReducerOnUpdateDmlSelfTest.java |  5 ++++
 12 files changed, 81 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e2778462/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcDistributedJoinsQueryTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcDistributedJoinsQueryTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcDistributedJoinsQueryTest.java
index bcf6159..611a883 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcDistributedJoinsQueryTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcDistributedJoinsQueryTest.java
@@ -307,4 +307,8 @@ public class JdbcDistributedJoinsQueryTest extends GridCommonAbstractTest {
         }
     }
 
+    /** {@inheritDoc} */
+    @Override protected void setConsistentId(IgniteConfiguration cfg, String igniteInstanceName) {
+        // No-op.
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2778462/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/MigratingToWalV2SerializerWithCompactionTest.java
----------------------------------------------------------------------
diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/MigratingToWalV2SerializerWithCompactionTest.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/MigratingToWalV2SerializerWithCompactionTest.java
index d4c58f8..ddeee66 100644
--- a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/MigratingToWalV2SerializerWithCompactionTest.java
+++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/MigratingToWalV2SerializerWithCompactionTest.java
@@ -243,4 +243,9 @@ public class MigratingToWalV2SerializerWithCompactionTest extends IgnitePersiste
             cfg.setDataStorageConfiguration(memCfg);
         }
     }
+
+    /** {@inheritDoc} */
+    @Override protected void setConsistentId(IgniteConfiguration cfg, String igniteInstanceName) {
+        // No-op.
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2778462/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/PersistenceBasicCompatibilityTest.java
----------------------------------------------------------------------
diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/PersistenceBasicCompatibilityTest.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/PersistenceBasicCompatibilityTest.java
index f27caa3..12f94df 100644
--- a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/PersistenceBasicCompatibilityTest.java
+++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/PersistenceBasicCompatibilityTest.java
@@ -377,4 +377,9 @@ public class PersistenceBasicCompatibilityTest extends IgnitePersistenceCompatib
                 '}';
         }
     }
+
+    /** {@inheritDoc} */
+    @Override protected void setConsistentId(IgniteConfiguration cfg, String igniteInstanceName) {
+        // No-op.
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2778462/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
index 3c0f001..3336a4d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
@@ -39,6 +39,7 @@ import org.apache.ignite.cache.CacheEntryProcessor;
 import org.apache.ignite.cache.CacheMetrics;
 import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.IgniteKernal;
 import org.apache.ignite.internal.util.lang.GridAbsPredicateX;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -1351,4 +1352,9 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         assertTrue(cache.localMetrics().getEntryProcessorAverageInvocationTime() > 0.0);
     }
+
+    /** {@inheritDoc} */
+    @Override protected void setConsistentId(IgniteConfiguration cfg, String igniteInstanceName) {
+        // No-op.
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2778462/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataOnClusterRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataOnClusterRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataOnClusterRestartTest.java
index 9121cca..e7475ce 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataOnClusterRestartTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataOnClusterRestartTest.java
@@ -358,8 +358,8 @@ public class IgnitePdsBinaryMetadataOnClusterRestartTest extends GridCommonAbstr
     ) throws Exception {
         String workDir = U.defaultWorkDirectory();
 
-        Path fromFile = Paths.get(workDir, fromWorkDir, "binary_meta", fromConsId, fileName);
-        Path toFile = Paths.get(workDir, toWorkDir, "binary_meta", toConsId, fileName);
+        Path fromFile = Paths.get(workDir, fromWorkDir, "binary_meta", U.maskForFileName(fromConsId), fileName);
+        Path toFile = Paths.get(workDir, toWorkDir, "binary_meta", U.maskForFileName(toConsId), fileName);
 
         Files.copy(fromFile, toFile, StandardCopyOption.REPLACE_EXISTING);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2778462/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/filename/IgniteUidAsConsistentIdMigrationTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/filename/IgniteUidAsConsistentIdMigrationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/filename/IgniteUidAsConsistentIdMigrationTest.java
index 6e8ef65..e579038 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/filename/IgniteUidAsConsistentIdMigrationTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/filename/IgniteUidAsConsistentIdMigrationTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache.persistence.db.filename;
 
 import java.io.File;
 import java.io.IOException;
+import java.io.Serializable;
 import java.util.Arrays;
 import java.util.Set;
 import java.util.TreeSet;
@@ -351,13 +352,19 @@ public class IgniteUidAsConsistentIdMigrationTest extends GridCommonAbstractTest
      * @return name of storage related subfolders
      */
     @NotNull private String genNewStyleSubfolderName(final int nodeIdx, final Ignite ignite) {
-        final Object consistentId = ignite.cluster().localNode().consistentId();
+        Serializable userDefinedConsistentID = ignite.configuration().getConsistentId();
 
-        assertTrue("For new style folders consistent ID should be UUID," +
-                " but actual class is " + (consistentId == null ? null : consistentId.getClass()),
-            consistentId instanceof UUID);
+        if (userDefinedConsistentID != null)
+            return U.maskForFileName(userDefinedConsistentID.toString());
+        else {
+            final Object consistentId = ignite.cluster().localNode().consistentId();
 
-        return PdsConsistentIdProcessor.genNewStyleSubfolderName(nodeIdx, (UUID)consistentId);
+            assertTrue("For new style folders consistent ID should be UUID," +
+                    " but actual class is " + (consistentId == null ? null : consistentId.getClass()),
+                consistentId instanceof UUID);
+
+            return PdsConsistentIdProcessor.genNewStyleSubfolderName(nodeIdx, (UUID)consistentId);
+        }
     }
 
     /**
@@ -571,9 +578,8 @@ public class IgniteUidAsConsistentIdMigrationTest extends GridCommonAbstractTest
     }
 
     /**
-     * Test case If there are no matching folders,
-     * but the directory contains old-style consistent IDs.
-     * Ignite should print out a warning.
+     * Test case If there are no matching folders, but the directory contains old-style consistent IDs. Ignite should
+     * print out a warning.
      *
      * @throws Exception if failed.
      */
@@ -706,4 +712,8 @@ public class IgniteUidAsConsistentIdMigrationTest extends GridCommonAbstractTest
             + " is expected to exist [" + path + "]", curFolder.exists() && curFolder.isDirectory());
     }
 
+    /** {@inheritDoc} */
+    @Override protected void setConsistentId(IgniteConfiguration cfg, String igniteInstanceName) {
+        // No-op.
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2778462/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java
index beab138..85c1326 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java
@@ -209,9 +209,7 @@ public class IgniteWalReaderTest extends GridCommonAbstractTest {
 
         ignite0.cluster().active(true);
 
-        Serializable consistentId = (Serializable)ignite0.cluster().localNode().consistentId();
-
-        String subfolderName = genNewStyleSubfolderName(0, (UUID)consistentId);
+        String subfolderName = genDbSubfolderName(ignite0, 0);
 
         int cacheObjectsToWrite = 10_000;
 
@@ -540,7 +538,10 @@ public class IgniteWalReaderTest extends GridCommonAbstractTest {
      * @return folder file name.
      */
     @NotNull private String genDbSubfolderName(Ignite ignite, int nodeIdx) {
-        return genNewStyleSubfolderName(nodeIdx, (UUID)ignite.cluster().localNode().consistentId());
+        if (ignite.configuration().getConsistentId() != null)
+            return U.maskForFileName(ignite.cluster().localNode().consistentId().toString());
+        else
+            return genNewStyleSubfolderName(nodeIdx, (UUID)ignite.cluster().localNode().consistentId());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2778462/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryNoUnsubscribeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryNoUnsubscribeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryNoUnsubscribeTest.java
index d683346..b0f22c5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryNoUnsubscribeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryNoUnsubscribeTest.java
@@ -152,4 +152,9 @@ public class IgniteCacheContinuousQueryNoUnsubscribeTest extends GridCommonAbstr
             return true;
         }
     }
+
+    /** {@inheritDoc} */
+    @Override protected void setConsistentId(IgniteConfiguration cfg, String igniteInstanceName) {
+        // No-op.
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2778462/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
index 817c56b..4ddc155 100755
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
@@ -908,6 +908,9 @@ public abstract class GridAbstractTest extends TestCase {
      */
     protected Ignite startGrid(String igniteInstanceName, IgniteConfiguration cfg, GridSpringResourceContext ctx)
         throws Exception {
+
+        setConsistentId(cfg, igniteInstanceName);
+
         if (!isRemoteJvm(igniteInstanceName)) {
             IgniteUtils.setCurrentIgniteName(igniteInstanceName);
 
@@ -953,6 +956,20 @@ public abstract class GridAbstractTest extends TestCase {
     }
 
     /**
+     * @param cfg Configuration.
+     * @param igniteInstanceName Ignite instance name.
+     */
+    protected void setConsistentId(IgniteConfiguration cfg, String igniteInstanceName) {
+        if (cfg.getConsistentId() == null) {
+            String seed = igniteInstanceName != null ? igniteInstanceName : getClass().getName();
+
+            UUID uuid = UUID.nameUUIDFromBytes(seed.getBytes());
+
+            cfg.setConsistentId(uuid);
+        }
+    }
+
+    /**
      * Starts new grid at another JVM with given name.
      *
      * @param igniteInstanceName Ignite instance name.
@@ -982,6 +999,7 @@ public abstract class GridAbstractTest extends TestCase {
         IgniteConfiguration cfg = F.first(cfgMap.get1());
 
         cfg.setIgniteInstanceName(gridName);
+        cfg.setConsistentId(gridName);
         cfg.setClientMode(client);
 
         return IgnitionEx.start(cfg, cfgMap.getValue());
@@ -1048,6 +1066,8 @@ public abstract class GridAbstractTest extends TestCase {
         if (cfg == null)
             cfg = optimize(getConfiguration(igniteInstanceName));
 
+        setConsistentId(cfg, igniteInstanceName);
+
         if (locNode != null) {
             DiscoverySpi discoverySpi = locNode.configuration().getDiscoverySpi();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2778462/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectFieldsQuerySelfTest.java
index 21e4852..00a9e4c 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectFieldsQuerySelfTest.java
@@ -297,4 +297,9 @@ public class IgniteBinaryObjectFieldsQuerySelfTest extends GridCommonAbstractTes
             return key.<Integer>field("id") <= maxId;
         }
     }
+
+    /** {@inheritDoc} */
+    @Override protected void setConsistentId(IgniteConfiguration cfg, String igniteInstanceName) {
+        // No-op.
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2778462/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoveryTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoveryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoveryTest.java
index e0703a5..e4744e3 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoveryTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoveryTest.java
@@ -736,8 +736,7 @@ public class IgniteWalRecoveryTest extends GridCommonAbstractTest {
      * @throws IgniteCheckedException If fail.
      */
     private File cacheDir(final String cacheName, final String consId) throws IgniteCheckedException {
-        final String subfolderName
-            = PdsConsistentIdProcessor.genNewStyleSubfolderName(0, UUID.fromString(consId));
+        final String subfolderName = U.maskForFileName(consId);
 
         final File dbDir = U.resolveWorkDirectory(U.defaultWorkDirectory(), DFLT_STORE_DIR, false);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2778462/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlSelfTest.java
index 0a41d94..6e7ca1b 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlSelfTest.java
@@ -748,4 +748,9 @@ public class IgniteSqlSkipReducerOnUpdateDmlSelfTest extends GridCommonAbstractT
 
         return rate - 1;
     }
+
+    /** {@inheritDoc} */
+    @Override protected void setConsistentId(IgniteConfiguration cfg, String igniteInstanceName) {
+        // No-op.
+    }
 }


[3/8] ignite git commit: IGNITE-10351 Web Console: Added new fields sysWorkerBlockedTimeout and checkpointReadLockTimeout to "Configuration" screen.

Posted by sb...@apache.org.
IGNITE-10351 Web Console: Added new fields sysWorkerBlockedTimeout and checkpointReadLockTimeout to "Configuration" screen.


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

Branch: refs/heads/ignite-10044
Commit: 296737a1b63c42a4fa1f398a881872c9f3b21b05
Parents: 8bd59cc
Author: Vasiliy Sisko <vs...@gridgain.com>
Authored: Wed Nov 21 00:17:58 2018 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Wed Nov 21 00:17:58 2018 +0700

----------------------------------------------------------------------
 modules/web-console/backend/app/schemas.js             |  4 +++-
 .../cluster-edit-form/templates/data-storage.pug       |  9 +++++++++
 .../cluster-edit-form/templates/failover.pug           |  9 +++++++++
 .../configuration/generator/ConfigurationGenerator.js  | 13 +++++++++++--
 4 files changed, 32 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/296737a1/modules/web-console/backend/app/schemas.js
----------------------------------------------------------------------
diff --git a/modules/web-console/backend/app/schemas.js b/modules/web-console/backend/app/schemas.js
index cf174f7..69d4a4c 100644
--- a/modules/web-console/backend/app/schemas.js
+++ b/modules/web-console/backend/app/schemas.js
@@ -985,6 +985,7 @@ module.exports.factory = function(mongoose) {
         consistentId: String,
         failureDetectionTimeout: Number,
         clientFailureDetectionTimeout: Number,
+        systemWorkerBlockedTimeout: Number,
         workDirectory: String,
         lateAffinityAssignment: Boolean,
         utilityCacheKeepAliveTime: Number,
@@ -1054,7 +1055,8 @@ module.exports.factory = function(mongoose) {
             fileIOFactory: {type: String, enum: ['RANDOM', 'ASYNC']},
             walAutoArchiveAfterInactivity: Number,
             writeThrottlingEnabled: Boolean,
-            walCompactionEnabled: Boolean
+            walCompactionEnabled: Boolean,
+            checkpointReadLockTimeout: Number
         },
         memoryConfiguration: {
             systemCacheInitialSize: Number,

http://git-wip-us.apache.org/repos/asf/ignite/blob/296737a1/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/data-storage.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/data-storage.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/data-storage.pug
index e18b0cb..8f9a33e 100644
--- a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/data-storage.pug
+++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/data-storage.pug
@@ -256,6 +256,15 @@ panel-collapsible(ng-show='$ctrl.available("2.3.0")' ng-form=form on-open=`ui.lo
                     min: '1',
                     tip: 'Frequency which is a minimal interval when the dirty pages will be written to the Persistent Store'
                 })
+            .pc-form-grid-col-60(ng-if='$ctrl.available("2.7.0")')
+                +form-field__number({
+                    label: 'Checkpoint read lock timeout:',
+                    model: `${model}.checkpointReadLockTimeout`,
+                    name: '"DataStorageCheckpointReadLockTimeout"',
+                    placeholder: 'System workers blocked timeout',
+                    min: '1',
+                    tip: 'Timeout for checkpoint read lock acquisition'
+                })
             .pc-form-grid-col-20
                 +form-field__number({
                     label: 'Checkpoint threads:',

http://git-wip-us.apache.org/repos/asf/ignite/blob/296737a1/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/failover.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/failover.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/failover.pug
index 3fafe9f..27797ed 100644
--- a/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/failover.pug
+++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/failover.pug
@@ -47,6 +47,15 @@ panel-collapsible(ng-form=form on-open=`ui.loadPanel('${form}')`)
                     min: '1',
                     tip: 'Failure detection timeout is used to determine how long the communication or discovery SPIs should wait before considering a remote connection failed'
                 })
+            .pc-form-grid-col-60(ng-if='$ctrl.available("2.7.0")')
+                +form-field__number({
+                    label: 'System workers blocked timeout:',
+                    model: model + '.systemWorkerBlockedTimeout',
+                    name: '"SystemWorkerBlockedTimeout"',
+                    placeholder: 'Failure detection timeout',
+                    min: '1',
+                    tip: 'Maximum inactivity period for system worker'
+                })
 
             .pc-form-grid-col-60
                 mixin clusters-failover-spi

http://git-wip-us.apache.org/repos/asf/ignite/blob/296737a1/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js b/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
index d80967e..6fba32a 100644
--- a/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
+++ b/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
@@ -1131,6 +1131,9 @@ export default class IgniteConfigurationGenerator {
         if (available('2.0.0')) {
             cfg.longProperty('failureDetectionTimeout')
                 .longProperty('clientFailureDetectionTimeout');
+
+            if (available('2.7.0'))
+                cfg.longProperty('systemWorkerBlockedTimeout');
         }
 
         _.forEach(cluster.failoverSpi, (spi) => {
@@ -1465,8 +1468,14 @@ export default class IgniteConfigurationGenerator {
             storageBean.varArgProperty('dataRegionConfigurations', 'dataRegionConfigurations', dataRegionCfgs, 'org.apache.ignite.configuration.DataRegionConfiguration');
 
         storageBean.stringProperty('storagePath')
-            .longProperty('checkpointFrequency')
-            .intProperty('checkpointThreads')
+            .longProperty('checkpointFrequency');
+
+        if (available('2.7.0')) {
+            storageBean
+                .longProperty('checkpointReadLockTimeout');
+        }
+
+        storageBean.intProperty('checkpointThreads')
             .enumProperty('checkpointWriteOrder')
             .enumProperty('walMode')
             .stringProperty('walPath')


[6/8] ignite git commit: Merge remote-tracking branch 'origin/ignite-10044' into ignite-10044

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-10044' into ignite-10044

# Conflicts:
#	modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java


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

Branch: refs/heads/ignite-10044
Commit: c4683f026873e977917518c88875bed69f6d496c
Parents: 134f433 763ea32
Author: sboikov <sb...@apache.org>
Authored: Tue Nov 20 20:52:21 2018 +0300
Committer: sboikov <sb...@apache.org>
Committed: Tue Nov 20 20:52:21 2018 +0300

----------------------------------------------------------------------
 .../distributed/IgniteCachePartitionLossPolicySelfTest.java   | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c4683f02/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java
index ea00b1f,be16e60..324a68d
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java
@@@ -569,23 -526,18 +569,22 @@@ public class IgniteCachePartitionLossPo
  
              info("Newly started node: " + grd.cluster().localNode().id());
  
 -            verifyLostPartitions(grd, lostParts);
 +            for (String cacheName : CACHE_NAMES) {
 +                verifyLostPartitions(grd, cacheName, lostPartsMap.get(cacheName));
  
 -            // Check that partition state does not change after we start each node.
 -            for (Ignite ig : G.allGrids()) {
 -                verifyLostPartitions(ig, lostParts);
 +                // Check that partition state does not change after we start each node.
 +                for (Ignite ig : G.allGrids()) {
 +                    if (skipCache(ig, cacheName))
 +                        continue;
 +
 +                    verifyLostPartitions(ig, cacheName, lostPartsMap.get(cacheName));
  
 -                verifyCacheOps(canWrite, safe, ig);
 +                    verifyCacheOps(cacheName, canWrite, safe, ig);
  
-                     // TODO Query effectively waits for rebalance due to https://issues.apache.org/jira/browse/IGNITE-10057
-                     // TODO and after resetLostPartition there is another OWNING copy in the cluster due to https://issues.apache.org/jira/browse/IGNITE-10058.
-                     // TODO Uncomment after https://issues.apache.org/jira/browse/IGNITE-10058 is fixed.
+                 // TODO Query effectively waits for rebalance due to https://issues.apache.org/jira/browse/IGNITE-10057
+                 // TODO and after resetLostPartition there is another OWNING copy in the cluster due to https://issues.apache.org/jira/browse/IGNITE-10058.
+                 // TODO Uncomment after https://issues.apache.org/jira/browse/IGNITE-10058 is fixed.
  //                    validateQuery(safe, ig);
-                 }
              }
          }
  


[7/8] ignite git commit: ignite-10044

Posted by sb...@apache.org.
ignite-10044


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

Branch: refs/heads/ignite-10044
Commit: b591ef8ee4cfe226499d9ea007f7c83c3306d9aa
Parents: c4683f0
Author: sboikov <sb...@apache.org>
Authored: Tue Nov 20 20:55:38 2018 +0300
Committer: sboikov <sb...@apache.org>
Committed: Tue Nov 20 23:40:34 2018 +0300

----------------------------------------------------------------------
 .../cache/CacheAffinitySharedManager.java       |   4 +
 .../GridDhtPartitionsExchangeFuture.java        |   4 +-
 .../IgniteCachePartitionLossPolicySelfTest.java | 173 ++++++++++---------
 3 files changed, 101 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b591ef8e/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 936dc3e..5b3cfd5 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
@@ -499,6 +499,8 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
                                     null);
                             }
 
+                            grp.topology().detectLostPartitions(topVer, null);
+
                             assert grpHolder.affinity().lastVersion().equals(grp.affinity().lastVersion());
                         }
                     }
@@ -561,6 +563,8 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
 
                 grp.topology().update(topVer, partMap, null, Collections.<Integer>emptySet(), null, null);
 
+                grp.topology().detectLostPartitions(topVer, null);
+
                 topFut.validate(grp, discoCache.allNodes());
             }
             catch (IgniteCheckedException e) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/b591ef8e/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 0d594c0..f5d1a13 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
@@ -3297,12 +3297,12 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
 
                 if (discoveryCustomMessage instanceof DynamicCacheChangeBatch) {
                     if (exchActions != null) {
-                        assignPartitionsStates();
-
                         Set<String> caches = exchActions.cachesToResetLostPartitions();
 
                         if (!F.isEmpty(caches))
                             resetLostPartitions(caches, true);
+
+                        assignPartitionsStates();
                     }
                 }
                 else if (discoveryCustomMessage instanceof SnapshotDiscoveryMessage

http://git-wip-us.apache.org/repos/asf/ignite/blob/b591ef8e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java
index 324a68d..26ef0b7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java
@@ -94,11 +94,17 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
 
     /** */
     private final TopologyChanger killSingleNode = new TopologyChanger(
-        false, singletonList(3), asList(0, 1, 2, 4), 0);
+        4, false, singletonList(3), asList(0, 1, 2, 4), 0);
 
     /** */
     private boolean isPersistenceEnabled;
 
+    /** */
+    private boolean cacheInCfg = true;
+
+    /** */
+    private boolean clientCacheOnCrd;
+
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -116,14 +122,16 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
 
         cfg.setClientMode(client);
 
-        CacheConfiguration[] ccfgs;
+        if (cacheInCfg) {
+            CacheConfiguration[] ccfgs;
 
-        if (gridName.equals(getTestIgniteInstanceName(0)))
-            ccfgs = new CacheConfiguration[]{cacheConfiguration(DEFAULT_CACHE_NAME)};
-        else
-            ccfgs = new CacheConfiguration[]{cacheConfiguration(DEFAULT_CACHE_NAME), cacheConfiguration(CACHE_EXCLUDE_ON_CRD)};
+            if (gridName.equals(getTestIgniteInstanceName(0)))
+                ccfgs = new CacheConfiguration[]{cacheConfiguration(DEFAULT_CACHE_NAME)};
+            else
+                ccfgs = new CacheConfiguration[]{cacheConfiguration(DEFAULT_CACHE_NAME), cacheConfiguration(CACHE_EXCLUDE_ON_CRD)};
 
-        cfg.setCacheConfiguration(ccfgs);
+            cfg.setCacheConfiguration(ccfgs);
+        }
 
         cfg.setConsistentId(gridName);
 
@@ -200,11 +208,9 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
      * @throws Exception if failed.
      */
     public void testReadOnlySafeWithPersistence() throws Exception {
-        partLossPlc = PartitionLossPolicy.READ_ONLY_SAFE;
-
         isPersistenceEnabled = true;
 
-        checkLostPartition(false, true, killSingleNode);
+        testReadOnlySafe();
     }
 
     /**
@@ -222,11 +228,9 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
     public void testReadOnlyAllWithPersistence() throws Exception {
         fail("https://issues.apache.org/jira/browse/IGNITE-10041");
 
-        partLossPlc = PartitionLossPolicy.READ_ONLY_ALL;
-
         isPersistenceEnabled = true;
 
-        checkLostPartition(false, false, killSingleNode);
+        testReadOnlyAll();
     }
 
     /**
@@ -242,11 +246,9 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
      * @throws Exception if failed.
      */
     public void testReadWriteSafeWithPersistence() throws Exception {
-        partLossPlc = PartitionLossPolicy.READ_WRITE_SAFE;
-
         isPersistenceEnabled = true;
 
-        checkLostPartition(true, true, killSingleNode);
+        testReadWriteSafe();
     }
 
     /**
@@ -264,11 +266,9 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
     public void testReadWriteAllWithPersistence() throws Exception {
         fail("https://issues.apache.org/jira/browse/IGNITE-10041");
 
-        partLossPlc = PartitionLossPolicy.READ_WRITE_ALL;
-
         isPersistenceEnabled = true;
 
-        checkLostPartition(true, false, killSingleNode);
+        testReadWriteAll();
     }
 
     /**
@@ -277,18 +277,16 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
     public void testReadWriteSafeAfterKillTwoNodes() throws Exception {
         partLossPlc = PartitionLossPolicy.READ_WRITE_SAFE;
 
-        checkLostPartition(true, true, new TopologyChanger(false, asList(3, 2), asList(0, 1, 4), 0));
+        checkLostPartition(true, true, new TopologyChanger(4, false, asList(3, 2), asList(0, 1, 4), 0));
     }
 
     /**
      * @throws Exception if failed.
      */
     public void testReadWriteSafeAfterKillTwoNodesWithPersistence() throws Exception {
-        partLossPlc = PartitionLossPolicy.READ_WRITE_SAFE;
-
         isPersistenceEnabled = true;
 
-        checkLostPartition(true, true, new TopologyChanger(false, asList(3, 2), asList(0, 1, 4), 0));
+        testReadWriteSafeAfterKillTwoNodes();
     }
 
     /**
@@ -297,18 +295,16 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
     public void testReadWriteSafeAfterKillTwoNodesWithDelay() throws Exception {
         partLossPlc = PartitionLossPolicy.READ_WRITE_SAFE;
 
-        checkLostPartition(true, true, new TopologyChanger(false, asList(3, 2), asList(0, 1, 4), 20));
+        checkLostPartition(true, true, new TopologyChanger(4, false, asList(3, 2), asList(0, 1, 4), 20));
     }
 
     /**
      * @throws Exception if failed.
      */
     public void testReadWriteSafeAfterKillTwoNodesWithDelayWithPersistence() throws Exception {
-        partLossPlc = PartitionLossPolicy.READ_WRITE_SAFE;
-
         isPersistenceEnabled = true;
 
-        checkLostPartition(true, true, new TopologyChanger(false, asList(3, 2), asList(0, 1, 4), 20));
+        testReadWriteSafeAfterKillTwoNodesWithDelay();
     }
 
     /**
@@ -319,20 +315,16 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
 
         backups = 1;
 
-        checkLostPartition(true, true, new TopologyChanger(true, asList(3, 2, 1), asList(0, 4), 0));
+        checkLostPartition(true, true, new TopologyChanger(4, true, asList(3, 2, 1), asList(0, 4), 0));
     }
 
     /**
      * @throws Exception if failed.
      */
     public void testReadWriteSafeWithBackupsAfterKillThreeNodesWithPersistence() throws Exception {
-        partLossPlc = PartitionLossPolicy.READ_WRITE_SAFE;
-
-        backups = 1;
-
         isPersistenceEnabled = true;
 
-        checkLostPartition(true, true, new TopologyChanger(true, asList(3, 2, 1), asList(0, 4), 0));
+        testReadWriteSafeWithBackupsAfterKillThreeNodes();
     }
 
     /**
@@ -341,18 +333,16 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
     public void testReadWriteSafeAfterKillCrd() throws Exception {
         partLossPlc = PartitionLossPolicy.READ_WRITE_SAFE;
 
-        checkLostPartition(true, true, new TopologyChanger(true, asList(3, 0), asList(1, 2, 4), 0));
+        checkLostPartition(true, true, new TopologyChanger(4, true, asList(3, 0), asList(1, 2, 4), 0));
     }
 
     /**
      * @throws Exception if failed.
      */
     public void testReadWriteSafeAfterKillCrdWithPersistence() throws Exception {
-        partLossPlc = PartitionLossPolicy.READ_WRITE_SAFE;
-
         isPersistenceEnabled = true;
 
-        checkLostPartition(true, true, new TopologyChanger(true, asList(3, 0), asList(1, 2, 4), 0));
+        testReadWriteSafeAfterKillCrd();
     }
 
     /**
@@ -363,20 +353,16 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
 
         backups = 1;
 
-        checkLostPartition(true, true, new TopologyChanger(true, asList(3, 2), asList(0, 1, 4), 0));
+        checkLostPartition(true, true, new TopologyChanger(4, true, asList(3, 2), asList(0, 1, 4), 0));
     }
 
     /**
      * @throws Exception if failed.
      */
     public void testReadWriteSafeWithBackupsWithPersistence() throws Exception {
-        partLossPlc = PartitionLossPolicy.READ_WRITE_SAFE;
-
-        backups = 1;
-
         isPersistenceEnabled = true;
 
-        checkLostPartition(true, true, new TopologyChanger(true, asList(3, 2), asList(0, 1, 4), 0));
+        testReadWriteSafeWithBackups();
     }
 
     /**
@@ -387,20 +373,16 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
 
         backups = 1;
 
-        checkLostPartition(true, true, new TopologyChanger(true, asList(3, 0), asList(1, 2, 4), 0));
+        checkLostPartition(true, true, new TopologyChanger(5, true, asList(3, 2, 0), asList(1, 4, 5), 0));
     }
 
     /**
      * @throws Exception if failed.
      */
     public void testReadWriteSafeWithBackupsAfterKillCrdWithPersistence() throws Exception {
-        partLossPlc = PartitionLossPolicy.READ_WRITE_SAFE;
-
-        backups = 1;
-
         isPersistenceEnabled = true;
 
-        checkLostPartition(true, true, new TopologyChanger(true, asList(3, 0), asList(1, 2, 4), 0));
+        testReadWriteSafeWithBackupsAfterKillCrd();
     }
 
     /**
@@ -422,11 +404,9 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
 
         fail("https://issues.apache.org/jira/browse/IGNITE-10041");
 
-        partLossPlc = PartitionLossPolicy.IGNORE;
-
         isPersistenceEnabled = true;
 
-        checkIgnore(killSingleNode);
+        testIgnore();
     }
 
     /**
@@ -438,7 +418,7 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
         // TODO aliveNodes should include node 4, but it fails due to https://issues.apache.org/jira/browse/IGNITE-5078.
         // TODO need to add 4 to the aliveNodes after IGNITE-5078 is fixed.
         // TopologyChanger onlyCrdIsAlive = new TopologyChanger(false, Arrays.asList(1, 2, 3), Arrays.asList(0, 4), 0);
-        TopologyChanger onlyCrdIsAlive = new TopologyChanger(false, asList(1, 2, 3), singletonList(0), 0);
+        TopologyChanger onlyCrdIsAlive = new TopologyChanger(4, false, asList(1, 2, 3), singletonList(0), 0);
 
         checkIgnore(onlyCrdIsAlive);
     }
@@ -449,16 +429,27 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
     public void testIgnoreKillThreeNodesWithPersistence() throws Exception {
         fail("https://issues.apache.org/jira/browse/IGNITE-10041");
 
-        partLossPlc = PartitionLossPolicy.IGNORE;
-
         isPersistenceEnabled = true;
 
-        // TODO aliveNodes should include node 4, but it fails due to https://issues.apache.org/jira/browse/IGNITE-5078.
-        // TODO need to add 4 to the aliveNodes after IGNITE-5078 is fixed.
-        // TopologyChanger onlyCrdIsAlive = new TopologyChanger(false, Arrays.asList(1, 2, 3), Arrays.asList(0, 4), 0);
-        TopologyChanger onlyCrdIsAlive = new TopologyChanger(false, asList(1, 2, 3), singletonList(0), 0);
+        testIgnoreKillThreeNodes();
+    }
 
-        checkIgnore(onlyCrdIsAlive);
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStartClientCacheOnCoordinator() throws Exception {
+        clientCacheOnCrd = true;
+
+        testReadWriteSafe();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStartClientCacheOnCoordinatorWithPersistence() throws Exception {
+        isPersistenceEnabled = true;
+
+        testStartClientCacheOnCoordinator();
     }
 
     /**
@@ -524,7 +515,7 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
 
         for (Ignite ig : G.allGrids()) {
             for (String cacheName : CACHE_NAMES) {
-                if (skipCache(ig, cacheName))
+                if (!clientCacheOnCrd && skipCache(ig, cacheName))
                     continue;
 
                 info("Checking node [cache=" + cacheName + ", node=" + ig.cluster().localNode().id() + ']');
@@ -561,6 +552,13 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
         }
 
         checkNewNode(true, canWrite, safe);
+
+        cacheInCfg = false; // Check case when client cache is started dynamically.
+
+        checkNewNode(true, canWrite, safe);
+
+        cacheInCfg = true;
+
         checkNewNode(false, canWrite, safe);
 
         // Bring all nodes back.
@@ -570,35 +568,37 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
             info("Newly started node: " + grd.cluster().localNode().id());
 
             for (String cacheName : CACHE_NAMES) {
-                verifyLostPartitions(grd, cacheName, lostPartsMap.get(cacheName));
+                if (clientCacheOnCrd || !skipCache(grd, cacheName))
+                    verifyLostPartitions(grd, cacheName, lostPartsMap.get(cacheName));
 
                 // Check that partition state does not change after we start each node.
                 for (Ignite ig : G.allGrids()) {
-                    if (skipCache(ig, cacheName))
+                    if (!clientCacheOnCrd && skipCache(ig, cacheName))
                         continue;
 
                     verifyLostPartitions(ig, cacheName, lostPartsMap.get(cacheName));
 
                     verifyCacheOps(cacheName, canWrite, safe, ig);
 
-                // TODO Query effectively waits for rebalance due to https://issues.apache.org/jira/browse/IGNITE-10057
-                // TODO and after resetLostPartition there is another OWNING copy in the cluster due to https://issues.apache.org/jira/browse/IGNITE-10058.
-                // TODO Uncomment after https://issues.apache.org/jira/browse/IGNITE-10058 is fixed.
+                    // TODO Query effectively waits for rebalance due to https://issues.apache.org/jira/browse/IGNITE-10057
+                    // TODO and after resetLostPartition there is another OWNING copy in the cluster due to https://issues.apache.org/jira/browse/IGNITE-10058.
+                    // TODO Uncomment after https://issues.apache.org/jira/browse/IGNITE-10058 is fixed.
 //                    validateQuery(safe, ig);
+                }
             }
         }
 
         // Make sure cache did not really start on coordinator,
-        if (topChanger.aliveNodes.contains(0))
+        if (!clientCacheOnCrd && topChanger.aliveNodes.contains(0))
             assertNull(((IgniteEx)ignite(0)).context().cache().cacheGroup(CU.cacheId(CACHE_EXCLUDE_ON_CRD)));
 
-        ignite(4).resetLostPartitions(Arrays.asList(CACHE_NAMES));
+        ignite(topChanger.srvNodes).resetLostPartitions(Arrays.asList(CACHE_NAMES));
 
         awaitPartitionMapExchange(true, true, null);
 
         for (Ignite ig : G.allGrids()) {
             for (String cacheName : CACHE_NAMES) {
-                if (skipCache(ig, cacheName))
+                if (!clientCacheOnCrd && skipCache(ig, cacheName))
                     continue;
 
                 IgniteCache<Integer, Integer> cache = ig.cache(cacheName);
@@ -626,15 +626,19 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
         }
 
         // Make sure cache did not really start on coordinator,
-        if (topChanger.aliveNodes.contains(0))
+        if (!clientCacheOnCrd)
             assertNull(((IgniteEx)ignite(0)).context().cache().cacheGroup(CU.cacheId(CACHE_EXCLUDE_ON_CRD)));
 
-        // Start new node after lost partitions reset.
-        startGrid(5);
+        // Start new nodes after lost partitions reset.
+        startGrid(topChanger.srvNodes + 1);
+
+        client = true;
+
+        startGrid(topChanger.srvNodes + 2);
 
         for (Ignite ig : G.allGrids()) {
             for (String cacheName : CACHE_NAMES) {
-                if (skipCache(ig, cacheName))
+                if (!clientCacheOnCrd && skipCache(ig, cacheName))
                     continue;
 
                 IgniteCache<Integer, Integer> cache = ig.cache(cacheName);
@@ -661,6 +665,8 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
             IgniteEx cl = startGrid("newNode");
 
             for (String cacheName : CACHE_NAMES) {
+                cl.cache(cacheName); // Make sure cache started on node.`
+
                 CacheGroupContext grpCtx = cl.context().cache().cacheGroup(CU.cacheId(cacheName));
 
                 assertTrue(grpCtx.needsRecovery());
@@ -692,6 +698,7 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
     }
 
     /**
+     * @param cacheName Cache name.
      * @param canWrite {@code True} if writes are allowed.
      * @param safe {@code True} if lost partition should trigger exception.
      * @param ig Ignite instance.
@@ -743,6 +750,7 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
     }
 
     /**
+     * @param cacheName Cache name.
      * @param nodes List of nodes to find partition.
      * @return List of partitions that aren't primary or backup for specified nodes.
      */
@@ -898,6 +906,9 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
 
     /** */
     private class TopologyChanger {
+        /** */
+        private int srvNodes;
+
         /** Flag to delay partition exchange */
         private boolean delayExchange;
 
@@ -911,13 +922,19 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
         private long stopDelay;
 
         /**
+         * @param srvNodes Number of server nodes to start.
          * @param delayExchange Flag for delay partition exchange.
          * @param killNodes List of nodes to kill.
          * @param aliveNodes List of nodes to be alive.
          * @param stopDelay Delay between stopping nodes.
          */
-        private TopologyChanger(boolean delayExchange, List<Integer> killNodes, List<Integer> aliveNodes,
+        private TopologyChanger(
+            int srvNodes,
+            boolean delayExchange,
+            List<Integer> killNodes,
+            List<Integer> aliveNodes,
             long stopDelay) {
+            this.srvNodes = srvNodes;
             this.delayExchange = delayExchange;
             this.killNodes = killNodes;
             this.aliveNodes = aliveNodes;
@@ -929,7 +946,7 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
          * @throws Exception If failed.
          */
         private Map<String, List<Integer>> changeTopology() throws Exception {
-            startGrids(4);
+            startGrids(srvNodes);
 
             if (isPersistenceEnabled)
                 grid(0).cluster().active(true);
@@ -943,11 +960,11 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
 
             client = true;
 
-            startGrid(4);
+            startGrid(srvNodes);
 
             client = false;
 
-            for (int i = 0; i < 5; i++)
+            for (int i = 0; i < srvNodes + 1; i++)
                 info(">>> Node [idx=" + i + ", nodeId=" + ignite(i).cluster().localNode().id() + ']');
 
             awaitPartitionMapExchange();
@@ -960,7 +977,7 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
                 final List<Integer> parts = noPrimaryOrBackupPartition(cacheName, aliveNodes);
 
                 if (parts.isEmpty())
-                    throw new IllegalStateException("No partition on nodes: " + killNodes);
+                    throw new IllegalStateException("No lost partitions [cache=" + cacheName + ", killNodes=" + killNodes + ']');
 
                 lostParts.put(cacheName, parts);
 


[8/8] ignite git commit: Merge remote-tracking branch 'remotes/origin/master' into ignite-10044

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-10044


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

Branch: refs/heads/ignite-10044
Commit: 1a60eafc908c68017b496c0e111d1bf072abc592
Parents: b591ef8 e277846
Author: sboikov <sb...@apache.org>
Authored: Tue Nov 20 23:43:10 2018 +0300
Committer: sboikov <sb...@apache.org>
Committed: Tue Nov 20 23:43:10 2018 +0300

----------------------------------------------------------------------
 .../jdbc2/JdbcDistributedJoinsQueryTest.java    |  4 +++
 ...tingToWalV2SerializerWithCompactionTest.java |  5 ++++
 .../PersistenceBasicCompatibilityTest.java      |  5 ++++
 .../wal/serializer/RecordDataV1Serializer.java  |  4 ++-
 .../cache/GridCacheAbstractMetricsSelfTest.java |  6 +++++
 ...tePdsBinaryMetadataOnClusterRestartTest.java |  4 +--
 .../IgniteUidAsConsistentIdMigrationTest.java   | 26 ++++++++++++++------
 .../db/wal/reader/IgniteWalReaderTest.java      |  9 ++++---
 ...teCacheContinuousQueryNoUnsubscribeTest.java |  5 ++++
 .../testframework/junits/GridAbstractTest.java  | 20 +++++++++++++++
 .../IgniteBinaryObjectFieldsQuerySelfTest.java  |  5 ++++
 .../db/wal/IgniteWalRecoveryTest.java           |  3 +--
 ...IgniteSqlSkipReducerOnUpdateDmlSelfTest.java |  5 ++++
 modules/web-console/backend/app/schemas.js      |  4 ++-
 modules/web-console/backend/index.js            | 10 ++++----
 modules/web-console/backend/launch-tools.js     | 20 ++++++++++++++-
 .../templates/data-storage.pug                  |  9 +++++++
 .../cluster-edit-form/templates/failover.pug    |  9 +++++++
 .../generator/ConfigurationGenerator.js         | 13 ++++++++--
 19 files changed, 140 insertions(+), 26 deletions(-)
----------------------------------------------------------------------



[5/8] ignite git commit: ignite-10044

Posted by sb...@apache.org.
ignite-10044


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

Branch: refs/heads/ignite-10044
Commit: 134f433ab8dc018fa4b19a8776ea19e75e69ebe4
Parents: 5466373
Author: sboikov <sb...@apache.org>
Authored: Tue Nov 20 17:53:48 2018 +0300
Committer: sboikov <sb...@apache.org>
Committed: Tue Nov 20 20:48:27 2018 +0300

----------------------------------------------------------------------
 .../GridDhtPartitionsExchangeFuture.java        |   2 +
 .../topology/GridClientPartitionTopology.java   |   3 -
 .../IgniteCachePartitionLossPolicySelfTest.java | 328 ++++++++++++-------
 ...ndexingCachePartitionLossPolicySelfTest.java |  19 +-
 4 files changed, 229 insertions(+), 123 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/134f433a/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 0cef226..0d594c0 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
@@ -3001,6 +3001,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
      * Detect lost partitions.
      *
      * @param resTopVer Result topology version.
+     * @param crd {@code True} if run on coordinator.
      */
     private void detectLostPartitions(AffinityTopologyVersion resTopVer, boolean crd) {
         boolean detected = false;
@@ -3042,6 +3043,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
 
     /**
      * @param cacheNames Cache names.
+     * @param crd {@code True} if run on coordinator.
      */
     private void resetLostPartitions(Collection<String> cacheNames, boolean crd) {
         assert !exchCtx.mergeExchanges();

http://git-wip-us.apache.org/repos/asf/ignite/blob/134f433a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridClientPartitionTopology.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridClientPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridClientPartitionTopology.java
index a28b3b0..20fa45c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridClientPartitionTopology.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridClientPartitionTopology.java
@@ -32,10 +32,8 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.stream.Collectors;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
-import org.apache.ignite.cache.PartitionLossPolicy;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.events.DiscoveryEvent;
-import org.apache.ignite.events.EventType;
 import org.apache.ignite.internal.IgniteInterruptedCheckedException;
 import org.apache.ignite.internal.managers.discovery.DiscoCache;
 import org.apache.ignite.internal.processors.affinity.AffinityAssignment;
@@ -62,7 +60,6 @@ import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.jetbrains.annotations.Nullable;
 
-import static org.apache.ignite.events.EventType.EVT_CACHE_REBALANCE_PART_DATA_LOST;
 import static org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionState.EVICTED;
 import static org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionState.LOST;
 import static org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionState.MOVING;

http://git-wip-us.apache.org/repos/asf/ignite/blob/134f433a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java
index 226ae22..ea00b1f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.cache.distributed;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
@@ -74,6 +75,12 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
     private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
 
     /** */
+    private static final String CACHE_EXCLUDE_ON_CRD = "cache-exclude-crd";
+
+    /** */
+    private static final String[] CACHE_NAMES = {DEFAULT_CACHE_NAME, CACHE_EXCLUDE_ON_CRD};
+
+    /** */
     private boolean client;
 
     /** */
@@ -109,7 +116,14 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
 
         cfg.setClientMode(client);
 
-        cfg.setCacheConfiguration(cacheConfiguration());
+        CacheConfiguration[] ccfgs;
+
+        if (gridName.equals(getTestIgniteInstanceName(0)))
+            ccfgs = new CacheConfiguration[]{cacheConfiguration(DEFAULT_CACHE_NAME)};
+        else
+            ccfgs = new CacheConfiguration[]{cacheConfiguration(DEFAULT_CACHE_NAME), cacheConfiguration(CACHE_EXCLUDE_ON_CRD)};
+
+        cfg.setCacheConfiguration(ccfgs);
 
         cfg.setConsistentId(gridName);
 
@@ -124,10 +138,20 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
     }
 
     /**
+     * @param node Node.
+     * @param cacheName Cache name.
+     * @return {@code True} if do access cache on given node.
+     */
+    private boolean skipCache(Ignite node, String cacheName) {
+        return cacheName.equals(CACHE_EXCLUDE_ON_CRD) && getTestIgniteInstanceName(0).equals(node.name());
+    }
+
+    /**
+     * @param cacheName Cache name.
      * @return Cache configuration.
      */
-    protected CacheConfiguration<Integer, Integer> cacheConfiguration() {
-        CacheConfiguration<Integer, Integer> cacheCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
+    protected CacheConfiguration<Integer, Integer> cacheConfiguration(String cacheName) {
+        CacheConfiguration<Integer, Integer> cacheCfg = new CacheConfiguration<>(cacheName);
 
         cacheCfg.setCacheMode(PARTITIONED);
         cacheCfg.setBackups(backups);
@@ -135,6 +159,9 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
         cacheCfg.setPartitionLossPolicy(partLossPlc);
         cacheCfg.setAffinity(new RendezvousAffinityFunction(false, 32));
 
+        if (CACHE_EXCLUDE_ON_CRD.equals(cacheName))
+            cacheCfg.setNodeFilter(new TestCacheNodeExcludingFilter(getTestIgniteInstanceName(0)));
+
         return cacheCfg;
     }
 
@@ -441,19 +468,27 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
     private void checkIgnore(TopologyChanger topChanger) throws Exception {
         topChanger.changeTopology();
 
-        for (Ignite ig : G.allGrids()) {
-            IgniteCache<Integer, Integer> cache = ig.cache(DEFAULT_CACHE_NAME);
+        for (String cacheName : CACHE_NAMES) {
+            for (Ignite ig : G.allGrids()) {
+                if (skipCache(ig, cacheName))
+                    continue;
 
-            Collection<Integer> lost = cache.lostPartitions();
+                IgniteCache<Integer, Integer> cache = ig.cache(cacheName);
 
-            assertTrue("[grid=" + ig.name() + ", lost=" + lost.toString() + ']', lost.isEmpty());
+                Collection<Integer> lost = cache.lostPartitions();
 
-            int parts = ig.affinity(DEFAULT_CACHE_NAME).partitions();
+                assertTrue("[grid=" + ig.name() + ", lost=" + lost.toString() + ']', lost.isEmpty());
 
-            for (int i = 0; i < parts; i++) {
-                cache.get(i);
+                int parts = ig.affinity(cacheName).partitions();
 
-                cache.put(i, i);
+                for (int i = 0; i < parts; i++) {
+                    if (cacheName.equals(CACHE_EXCLUDE_ON_CRD) && ig.affinity(cacheName).mapPartitionToNode(i) == null)
+                        continue;
+
+                    cache.get(i);
+
+                    cache.put(i, i);
+                }
             }
         }
     }
@@ -467,7 +502,7 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
     private void checkLostPartition(boolean canWrite, boolean safe, TopologyChanger topChanger) throws Exception {
         assert partLossPlc != null;
 
-        List<Integer> lostParts = topChanger.changeTopology();
+        Map<String, List<Integer>> lostPartsMap = topChanger.changeTopology();
 
         // Wait for all grids (servers and client) have same topology version
         // to make sure that all nodes received map with lost partition.
@@ -488,32 +523,40 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
         assertTrue("Failed to wait for new topology", success);
 
         for (Ignite ig : G.allGrids()) {
-            info("Checking node: " + ig.cluster().localNode().id());
+            for (String cacheName : CACHE_NAMES) {
+                if (skipCache(ig, cacheName))
+                    continue;
 
-            IgniteCache<Integer, Integer> cache = ig.cache(DEFAULT_CACHE_NAME);
+                info("Checking node [cache=" + cacheName + ", node=" + ig.cluster().localNode().id() + ']');
 
-            verifyLostPartitions(ig, lostParts);
+                IgniteCache<Integer, Integer> cache = ig.cache(cacheName);
 
-            verifyCacheOps(canWrite, safe, ig);
+                verifyLostPartitions(ig, cacheName, lostPartsMap.get(cacheName));
 
-            validateQuery(safe, ig);
+                verifyCacheOps(cacheName, canWrite, safe, ig);
 
-            // TODO withPartitionRecover doesn't work with BLT - https://issues.apache.org/jira/browse/IGNITE-10041.
-            if (!isPersistenceEnabled) {
-                // Check we can read and write to lost partition in recovery mode.
-                IgniteCache<Integer, Integer> recoverCache = cache.withPartitionRecover();
+                validateQuery(safe, ig, cacheName);
 
-                for (int lostPart : recoverCache.lostPartitions()) {
-                    recoverCache.get(lostPart);
-                    recoverCache.put(lostPart, lostPart);
-                }
+                if (cacheName.equals(CACHE_EXCLUDE_ON_CRD) && lostPartsMap.get(cacheName).size() == ig.affinity(cacheName).partitions())
+                    continue;
+
+                // TODO withPartitionRecover doesn't work with BLT - https://issues.apache.org/jira/browse/IGNITE-10041.
+                if (!isPersistenceEnabled) {
+                    // Check we can read and write to lost partition in recovery mode.
+                    IgniteCache<Integer, Integer> recoverCache = cache.withPartitionRecover();
+
+                    for (int lostPart : recoverCache.lostPartitions()) {
+                        recoverCache.get(lostPart);
+                        recoverCache.put(lostPart, lostPart);
+                    }
 
-                // Check that writing in recover mode does not clear partition state.
-                verifyLostPartitions(ig, lostParts);
+                    // Check that writing in recover mode does not clear partition state.
+                    verifyLostPartitions(ig, cacheName, lostPartsMap.get(cacheName));
 
-                verifyCacheOps(canWrite, safe, ig);
+                    verifyCacheOps(cacheName, canWrite, safe, ig);
 
-                validateQuery(safe, ig);
+                    validateQuery(safe, ig, cacheName);
+                }
             }
         }
 
@@ -526,11 +569,17 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
 
             info("Newly started node: " + grd.cluster().localNode().id());
 
-            // Check that partition state does not change after we start each node.
-            // TODO With persistence enabled LOST partitions become OWNING after a node joins back - https://issues.apache.org/jira/browse/IGNITE-10044.
-            if (!isPersistenceEnabled) {
+            for (String cacheName : CACHE_NAMES) {
+                verifyLostPartitions(grd, cacheName, lostPartsMap.get(cacheName));
+
+                // Check that partition state does not change after we start each node.
                 for (Ignite ig : G.allGrids()) {
-                    verifyCacheOps(canWrite, safe, ig);
+                    if (skipCache(ig, cacheName))
+                        continue;
+
+                    verifyLostPartitions(ig, cacheName, lostPartsMap.get(cacheName));
+
+                    verifyCacheOps(cacheName, canWrite, safe, ig);
 
                     // TODO Query effectively waits for rebalance due to https://issues.apache.org/jira/browse/IGNITE-10057
                     // TODO and after resetLostPartition there is another OWNING copy in the cluster due to https://issues.apache.org/jira/browse/IGNITE-10058.
@@ -540,32 +589,59 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
             }
         }
 
-        ignite(4).resetLostPartitions(singletonList(DEFAULT_CACHE_NAME));
+        // Make sure cache did not really start on coordinator,
+        if (topChanger.aliveNodes.contains(0))
+            assertNull(((IgniteEx)ignite(0)).context().cache().cacheGroup(CU.cacheId(CACHE_EXCLUDE_ON_CRD)));
+
+        ignite(4).resetLostPartitions(Arrays.asList(CACHE_NAMES));
 
         awaitPartitionMapExchange(true, true, null);
 
         for (Ignite ig : G.allGrids()) {
-            IgniteCache<Integer, Integer> cache = ig.cache(DEFAULT_CACHE_NAME);
+            for (String cacheName : CACHE_NAMES) {
+                if (skipCache(ig, cacheName))
+                    continue;
 
-            assertTrue(cache.lostPartitions().isEmpty());
+                IgniteCache<Integer, Integer> cache = ig.cache(cacheName);
 
-            int parts = ig.affinity(DEFAULT_CACHE_NAME).partitions();
+                assertTrue(cache.lostPartitions().isEmpty());
 
-            for (int i = 0; i < parts; i++) {
-                cache.get(i);
+                int parts = ig.affinity(cacheName).partitions();
 
-                cache.put(i, i);
-            }
+                for (int i = 0; i < parts; i++) {
+                    cache.get(i);
 
-            for (int i = 0; i < parts; i++) {
-                checkQueryPasses(ig, false, i);
+                    cache.put(i, i);
+                }
+
+                for (int i = 0; i < parts; i++) {
+                    checkQueryPasses(ig, false, cacheName, i);
 
-                if (shouldExecuteLocalQuery(ig, i))
-                    checkQueryPasses(ig, true, i);
+                    if (shouldExecuteLocalQuery(ig, cacheName, i))
+                        checkQueryPasses(ig, true, cacheName, i);
+
+                }
 
+                checkQueryPasses(ig, false, cacheName);
             }
+        }
+
+        // Make sure cache did not really start on coordinator,
+        if (topChanger.aliveNodes.contains(0))
+            assertNull(((IgniteEx)ignite(0)).context().cache().cacheGroup(CU.cacheId(CACHE_EXCLUDE_ON_CRD)));
 
-            checkQueryPasses(ig, false);
+        // Start new node after lost partitions reset.
+        startGrid(5);
+
+        for (Ignite ig : G.allGrids()) {
+            for (String cacheName : CACHE_NAMES) {
+                if (skipCache(ig, cacheName))
+                    continue;
+
+                IgniteCache<Integer, Integer> cache = ig.cache(cacheName);
+
+                assertTrue(cache.lostPartitions().isEmpty());
+            }
         }
     }
 
@@ -583,15 +659,17 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
         this.client = client;
 
         try {
-            IgniteEx cl = (IgniteEx)startGrid("newNode");
+            IgniteEx cl = startGrid("newNode");
 
-            CacheGroupContext grpCtx = cl.context().cache().cacheGroup(CU.cacheId(DEFAULT_CACHE_NAME));
+            for (String cacheName : CACHE_NAMES) {
+                CacheGroupContext grpCtx = cl.context().cache().cacheGroup(CU.cacheId(cacheName));
 
-            assertTrue(grpCtx.needsRecovery());
+                assertTrue(grpCtx.needsRecovery());
 
-            verifyCacheOps(canWrite, safe, cl);
+                verifyCacheOps(cacheName, canWrite, safe, cl);
 
-            validateQuery(safe, cl);
+                validateQuery(safe, cl, cacheName);
+            }
         }
         finally {
             stopGrid("newNode", false);
@@ -602,10 +680,11 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
 
     /**
      * @param node Node.
+     * @param cacheName Cache name.
      * @param lostParts Lost partition IDs.
      */
-    private void verifyLostPartitions(Ignite node, List<Integer> lostParts) {
-        IgniteCache<Integer, Integer> cache = node.cache(DEFAULT_CACHE_NAME);
+    private void verifyLostPartitions(Ignite node, String cacheName, List<Integer> lostParts) {
+        IgniteCache<Integer, Integer> cache = node.cache(cacheName);
 
         Set<Integer> actualSortedLostParts = new TreeSet<>(cache.lostPartitions());
         Set<Integer> expSortedLostParts = new TreeSet<>(lostParts);
@@ -618,10 +697,10 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
      * @param safe {@code True} if lost partition should trigger exception.
      * @param ig Ignite instance.
      */
-    private void verifyCacheOps(boolean canWrite, boolean safe, Ignite ig) {
-        IgniteCache<Integer, Integer> cache = ig.cache(DEFAULT_CACHE_NAME);
+    private void verifyCacheOps(String cacheName, boolean canWrite, boolean safe, Ignite ig) {
+        IgniteCache<Integer, Integer> cache = ig.cache(cacheName);
 
-        int parts = ig.affinity(DEFAULT_CACHE_NAME).partitions();
+        int parts = ig.affinity(cacheName).partitions();
 
         // Check read.
         for (int i = 0; i < parts; i++) {
@@ -668,8 +747,8 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
      * @param nodes List of nodes to find partition.
      * @return List of partitions that aren't primary or backup for specified nodes.
      */
-    private List<Integer> noPrimaryOrBackupPartition(List<Integer> nodes) {
-        Affinity<Object> aff = ignite(4).affinity(DEFAULT_CACHE_NAME);
+    private List<Integer> noPrimaryOrBackupPartition(String cacheName, List<Integer> nodes) {
+        Affinity<Object> aff = ignite(4).affinity(cacheName);
 
         List<Integer> parts = new ArrayList<>();
 
@@ -699,9 +778,9 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
      * @param safe Safe flag.
      * @param node Node.
      */
-    private void validateQuery(boolean safe, Ignite node) {
+    private void validateQuery(boolean safe, Ignite node, String cacheName) {
         // Get node lost and remaining partitions.
-        IgniteCache<?, ?> cache = node.cache(DEFAULT_CACHE_NAME);
+        IgniteCache<?, ?> cache = node.cache(cacheName);
 
         Collection<Integer> lostParts = cache.lostPartitions();
 
@@ -709,7 +788,7 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
 
         Integer remainingPart = null;
 
-        for (int i = 0; i < node.affinity(DEFAULT_CACHE_NAME).partitions(); i++) {
+        for (int i = 0; i < node.affinity(cacheName).partitions(); i++) {
             if (lostParts.contains(i))
                 continue;
 
@@ -718,22 +797,25 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
             break;
         }
 
-        assertNotNull("Failed to find a partition that isn't lost", remainingPart);
+        if (remainingPart == null && cacheName.equals(CACHE_EXCLUDE_ON_CRD))
+            return;
+
+        assertNotNull("Failed to find a partition that isn't lost for cache: " + cacheName, remainingPart);
 
         // 1. Check query against all partitions.
-        validateQuery0(safe, node);
+        validateQuery0(safe, node, cacheName);
 
         // 2. Check query against LOST partition.
-        validateQuery0(safe, node, part);
+        validateQuery0(safe, node, cacheName, part);
 
         // 3. Check query on remaining partition.
-        checkQueryPasses(node, false, remainingPart);
+        checkQueryPasses(node, false, cacheName, remainingPart);
 
-        if (shouldExecuteLocalQuery(node, remainingPart))
-            checkQueryPasses(node, true, remainingPart);
+        if (shouldExecuteLocalQuery(node, cacheName, remainingPart))
+            checkQueryPasses(node, true, cacheName, remainingPart);
 
         // 4. Check query over two partitions - normal and LOST.
-        validateQuery0(safe, node, part, remainingPart);
+        validateQuery0(safe, node, cacheName, part, remainingPart);
     }
 
     /**
@@ -741,32 +823,33 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
      *
      * @param safe Safe flag.
      * @param node Node.
+     * @param cacheName Cache name.
      * @param parts Partitions.
      */
-    private void validateQuery0(boolean safe, Ignite node, int... parts) {
+    private void validateQuery0(boolean safe, Ignite node, String cacheName, int... parts) {
         if (safe)
-            checkQueryFails(node, false, parts);
+            checkQueryFails(node, false, cacheName, parts);
         else
-            checkQueryPasses(node, false, parts);
+            checkQueryPasses(node, false, cacheName, parts);
 
-        if (shouldExecuteLocalQuery(node, parts)) {
+        if (shouldExecuteLocalQuery(node, cacheName, parts)) {
             if (safe)
-                checkQueryFails(node, true, parts);
+                checkQueryFails(node, true, cacheName, parts);
             else
-                checkQueryPasses(node, true, parts);
+                checkQueryPasses(node, true, cacheName, parts);
         }
     }
 
     /**
      * @return true if the given node is primary for all given partitions.
      */
-    private boolean shouldExecuteLocalQuery(Ignite node, int... parts) {
+    private boolean shouldExecuteLocalQuery(Ignite node, String cacheName, int... parts) {
         if (parts == null || parts.length == 0)
             return false;
 
         int numOfPrimaryParts = 0;
 
-        for (int nodePrimaryPart : node.affinity(DEFAULT_CACHE_NAME).primaryPartitions(node.cluster().localNode())) {
+        for (int nodePrimaryPart : node.affinity(cacheName).primaryPartitions(node.cluster().localNode())) {
             for (int part : parts) {
                 if (part == nodePrimaryPart)
                     numOfPrimaryParts++;
@@ -781,7 +864,7 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
      * @param loc Local flag.
      * @param parts Partitions.
      */
-    protected void checkQueryPasses(Ignite node, boolean loc, int... parts) {
+    protected void checkQueryPasses(Ignite node, boolean loc, String cacheName, int... parts) {
         // Scan queries don't support multiple partitions.
         if (parts != null && parts.length > 1)
             return;
@@ -790,7 +873,7 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
         if (loc)
             return;
 
-        IgniteCache cache = node.cache(DEFAULT_CACHE_NAME);
+        IgniteCache cache = node.cache(cacheName);
 
         ScanQuery qry = new ScanQuery();
 
@@ -808,7 +891,7 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
      * @param loc Local flag.
      * @param parts Partitions.
      */
-    protected void checkQueryFails(Ignite node, boolean loc, int... parts) {
+    protected void checkQueryFails(Ignite node, boolean loc, String cacheName, int... parts) {
         // TODO Scan queries never fail due to partition loss - https://issues.apache.org/jira/browse/IGNITE-9902.
         // TODO Need to add an actual check after https://issues.apache.org/jira/browse/IGNITE-9902 is fixed.
         // No-op.
@@ -846,16 +929,18 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
          * @return Lost partition ID.
          * @throws Exception If failed.
          */
-        private List<Integer> changeTopology() throws Exception {
+        private Map<String, List<Integer>> changeTopology() throws Exception {
             startGrids(4);
 
             if (isPersistenceEnabled)
                 grid(0).cluster().active(true);
 
-            Affinity<Object> aff = ignite(0).affinity(DEFAULT_CACHE_NAME);
+            for (String cacheName : CACHE_NAMES) {
+                Affinity<Object> aff = ignite(1).affinity(cacheName);
 
-            for (int i = 0; i < aff.partitions(); i++)
-                ignite(0).cache(DEFAULT_CACHE_NAME).put(i, i);
+                for (int i = 0; i < aff.partitions(); i++)
+                    ignite(1).cache(cacheName).put(i, i);
+            }
 
             client = true;
 
@@ -868,35 +953,50 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
 
             awaitPartitionMapExchange();
 
-            final List<Integer> parts = noPrimaryOrBackupPartition(aliveNodes);
+            Map<String, List<Integer>> lostParts = new HashMap<>();
 
-            if (parts.isEmpty())
-                throw new IllegalStateException("No partition on nodes: " + killNodes);
+            Map<String, List<Map<Integer, Semaphore>>> lostMaps = new HashMap<>();
 
-            final List<Map<Integer, Semaphore>> lostMap = new ArrayList<>();
+            for (String cacheName : CACHE_NAMES) {
+                final List<Integer> parts = noPrimaryOrBackupPartition(cacheName, aliveNodes);
 
-            for (int i : aliveNodes) {
-                HashMap<Integer, Semaphore> semaphoreMap = new HashMap<>();
+                if (parts.isEmpty())
+                    throw new IllegalStateException("No partition on nodes: " + killNodes);
 
-                for (Integer part : parts)
-                    semaphoreMap.put(part, new Semaphore(0));
+                lostParts.put(cacheName, parts);
 
-                lostMap.add(semaphoreMap);
+                final List<Map<Integer, Semaphore>> lostMap = new ArrayList<>();
 
-                grid(i).events().localListen(new P1<Event>() {
-                    @Override public boolean apply(Event evt) {
-                        assert evt.type() == EventType.EVT_CACHE_REBALANCE_PART_DATA_LOST;
+                lostMaps.put(cacheName, lostMap);
 
-                        CacheRebalancingEvent cacheEvt = (CacheRebalancingEvent)evt;
+                for (int i : aliveNodes) {
+                    Ignite node = grid(i);
 
-                        if (F.eq(DEFAULT_CACHE_NAME, cacheEvt.cacheName())) {
-                            if (semaphoreMap.containsKey(cacheEvt.partition()))
-                                semaphoreMap.get(cacheEvt.partition()).release();
-                        }
+                    if (skipCache(node, cacheName))
+                        continue;
 
-                        return true;
-                    }
-                }, EventType.EVT_CACHE_REBALANCE_PART_DATA_LOST);
+                    HashMap<Integer, Semaphore> semaphoreMap = new HashMap<>();
+
+                    for (Integer part : parts)
+                        semaphoreMap.put(part, new Semaphore(0));
+
+                    lostMap.add(semaphoreMap);
+
+                    node.events().localListen(new P1<Event>() {
+                        @Override public boolean apply(Event evt) {
+                            assert evt.type() == EventType.EVT_CACHE_REBALANCE_PART_DATA_LOST;
+
+                            CacheRebalancingEvent cacheEvt = (CacheRebalancingEvent)evt;
+
+                            if (F.eq(cacheName, cacheEvt.cacheName())) {
+                                if (semaphoreMap.containsKey(cacheEvt.partition()))
+                                    semaphoreMap.get(cacheEvt.partition()).release();
+                            }
+
+                            return true;
+                        }
+                    }, EventType.EVT_CACHE_REBALANCE_PART_DATA_LOST);
+                }
             }
 
             if (delayExchange)
@@ -920,17 +1020,23 @@ public class IgniteCachePartitionLossPolicySelfTest extends GridCommonAbstractTe
 
             Thread.sleep(5_000L);
 
-            for (Map<Integer, Semaphore> map : lostMap) {
-                for (Map.Entry<Integer, Semaphore> entry : map.entrySet())
-                    assertTrue("Failed to wait for partition LOST event for partition: " + entry.getKey(), entry.getValue().tryAcquire(1));
-            }
+            for (String cacheName : CACHE_NAMES) {
+                List<Map<Integer, Semaphore>> lostMap = lostMaps.get(cacheName);
 
-            for (Map<Integer, Semaphore> map : lostMap) {
-                for (Map.Entry<Integer, Semaphore> entry : map.entrySet())
-                    assertFalse("Partition LOST event raised twice for partition: " + entry.getKey(), entry.getValue().tryAcquire(1));
+                for (Map<Integer, Semaphore> map : lostMap) {
+                    for (Map.Entry<Integer, Semaphore> entry : map.entrySet())
+                        assertTrue("Failed to wait for partition LOST event [cache=" + cacheName + ", part=" + entry.getKey() + ']',
+                            entry.getValue().tryAcquire(1));
+                }
+
+                for (Map<Integer, Semaphore> map : lostMap) {
+                    for (Map.Entry<Integer, Semaphore> entry : map.entrySet())
+                        assertFalse("Partition LOST event raised twice for partition [cache=" + cacheName + ", part=" + entry.getKey() + ']',
+                            entry.getValue().tryAcquire(1));
+                }
             }
 
-            return parts;
+            return lostParts;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/134f433a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IndexingCachePartitionLossPolicySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IndexingCachePartitionLossPolicySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IndexingCachePartitionLossPolicySelfTest.java
index 7007499..2c47392 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IndexingCachePartitionLossPolicySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IndexingCachePartitionLossPolicySelfTest.java
@@ -28,8 +28,8 @@ import org.apache.ignite.internal.processors.cache.distributed.IgniteCachePartit
  */
 public class IndexingCachePartitionLossPolicySelfTest extends IgniteCachePartitionLossPolicySelfTest {
     /** {@inheritDoc} */
-    @Override protected CacheConfiguration<Integer, Integer> cacheConfiguration() {
-        CacheConfiguration<Integer, Integer> ccfg = super.cacheConfiguration();
+    @Override protected CacheConfiguration<Integer, Integer> cacheConfiguration(String cacheName) {
+        CacheConfiguration<Integer, Integer> ccfg = super.cacheConfiguration(cacheName);
 
         ccfg.setIndexedTypes(Integer.class, Integer.class);
 
@@ -37,18 +37,18 @@ public class IndexingCachePartitionLossPolicySelfTest extends IgniteCachePartiti
     }
 
     /** {@inheritDoc} */
-    protected void checkQueryPasses(Ignite node, boolean loc, int... parts) {
-        executeQuery(node, loc, parts);
+    @Override protected void checkQueryPasses(Ignite node, boolean loc, String cacheName, int... parts) {
+        executeQuery(node, loc, cacheName, parts);
     }
 
     /** {@inheritDoc} */
-    protected void checkQueryFails(Ignite node, boolean loc, int... parts) {
+    @Override protected void checkQueryFails(Ignite node, boolean loc, String cacheName, int... parts) {
         // TODO: Local queries ignore partition loss, see https://issues.apache.org/jira/browse/IGNITE-7039.
         if (loc)
             return;
 
         try {
-            executeQuery(node, loc, parts);
+            executeQuery(node, loc, cacheName, parts);
 
             fail("Exception is not thrown.");
         }
@@ -64,12 +64,13 @@ public class IndexingCachePartitionLossPolicySelfTest extends IgniteCachePartiti
     /**
      * Execute SQL query on a given node.
      *
-     * @param parts Partitions.
      * @param node Node.
      * @param loc Local flag.
+     * @param cacheName Cache name.
+     * @param parts Partitions.
      */
-    private static void executeQuery(Ignite node, boolean loc, int... parts) {
-        IgniteCache cache = node.cache(DEFAULT_CACHE_NAME);
+    private static void executeQuery(Ignite node, boolean loc, String cacheName, int... parts) {
+        IgniteCache cache = node.cache(cacheName);
 
         SqlFieldsQuery qry = new SqlFieldsQuery("SELECT * FROM Integer");