This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 8065fd9  IGNITE-12942 control.sh add command for checking that inline 
size is same on all cluster nodes - Fixes #7728.
8065fd9 is described below

commit 8065fd9bc71c1a351d68ad45a18ae7768bb4bd7a
Author: Sergey Antonov <[email protected]>
AuthorDate: Thu May 7 21:24:08 2020 +0300

    IGNITE-12942 control.sh add command for checking that inline size is same 
on all cluster nodes - Fixes #7728.
    
    Signed-off-by: Ivan Rakov <[email protected]>
---
 .../ClientTcpUnreachableMultiNodeSelfTest.java     |   8 +
 .../ignite/internal/client/GridClientNode.java     |  17 ++
 .../client/impl/GridClientComputeImpl.java         |  16 +-
 .../internal/client/impl/GridClientNodeImpl.java   |  14 ++
 .../internal/commandline/BaselineCommand.java      |   5 +-
 .../commandline/cache/CacheCommandList.java        |   5 +
 .../internal/commandline/cache/CacheCommands.java  |   1 +
 .../commandline/cache/CacheSubcommands.java        |   7 +-
 .../commandline/cache/CheckIndexInlineSizes.java   | 152 +++++++++++++
 .../CheckIndexInlineSizesResult.java               |  96 ++++++++
 .../CheckIndexInlineSizesTask.java                 |  99 +++++++++
 .../processors/query/GridQueryIndexing.java        |  12 +
 .../processors/query/GridQueryProcessor.java       | 180 ++++++++++++---
 .../main/resources/META-INF/classnames.properties  |   3 +
 .../internal/client/thin/ComputeTaskTest.java      |  12 +-
 .../testframework/junits/GridAbstractTest.java     |   2 +-
 .../junits/multijvm/IgniteProcessProxy.java        |   3 +-
 ...mandHandlerClusterByClassTest_cache_help.output |   3 +
 ...dlerClusterByClassWithSSLTest_cache_help.output |   3 +
 .../processors/query/h2/IgniteH2Indexing.java      |  17 ++
 ...eckIndexesInlineSizeOnNodeJoinMultiJvmTest.java | 245 +++++++++++++++++++++
 .../IgniteBinaryCacheQueryTestSuite.java           |   2 +
 ...teCacheWithIndexingAndPersistenceTestSuite.java |   2 +
 ...idCommandHandlerCheckIndexesInlineSizeTest.java | 153 +++++++++++++
 ...idCommandHandlerIndexingClusterByClassTest.java |  16 ++
 25 files changed, 1018 insertions(+), 55 deletions(-)

diff --git 
a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
 
b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
index 362b978..25bab63 100644
--- 
a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
+++ 
b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
@@ -124,6 +124,14 @@ public class ClientTcpUnreachableMultiNodeSelfTest extends 
ClientTcpMultiNodeSel
                 @Override public long order() {
                     return node.order();
                 }
+
+                @Override public boolean isClient() {
+                    return node.isClient();
+                }
+
+                @Override public boolean isDaemon() {
+                    return node.isDaemon();
+                }
             };
         }
 
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientNode.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientNode.java
index 1df1c21..4cdf9ad 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientNode.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientNode.java
@@ -22,6 +22,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
+import org.apache.ignite.configuration.IgniteConfiguration;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -126,4 +127,20 @@ public interface GridClientNode {
      * @return Node startup order.
      */
     public long order();
+
+    /**
+     * Whether this node is client (see {@link 
IgniteConfiguration#isClientMode()}).
+     *
+     * @return {@code True if client}.
+     * @see IgniteConfiguration#isClientMode()
+     */
+    public boolean isClient();
+
+    /**
+     * Tests whether or not this node is a daemon (see {@link 
IgniteConfiguration#isDaemon()}).
+     *
+     * @return {@code True} if this node is a daemon, {@code false} otherwise.
+     * @see IgniteConfiguration#isDaemon()
+     */
+    public boolean isDaemon();
 }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java
index cabce32..fd79ea9 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java
@@ -33,7 +33,6 @@ import 
org.apache.ignite.internal.client.impl.connection.GridClientConnectionRes
 import org.apache.ignite.internal.util.typedef.internal.A;
 import org.jetbrains.annotations.Nullable;
 
-import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_DAEMON;
 import static 
org.apache.ignite.internal.client.util.GridClientUtils.applyFilter;
 
 /**
@@ -48,18 +47,7 @@ class GridClientComputeImpl extends 
GridClientAbstractProjection<GridClientCompu
     };
 
     /** */
-    private static final GridClientPredicate<GridClientNode> DAEMON = new 
GridClientPredicate<GridClientNode>() {
-        @Override public boolean apply(GridClientNode e) {
-            return "true".equals(e.<String>attribute(ATTR_DAEMON));
-        }
-    };
-
-    /** */
-    private static final GridClientPredicate<GridClientNode> NOT_DAEMON = new 
GridClientPredicate<GridClientNode>() {
-        @Override public boolean apply(GridClientNode e) {
-            return !"true".equals(e.<String>attribute(ATTR_DAEMON));
-        }
-    };
+    private static final GridClientPredicate<GridClientNode> NOT_DAEMON = n -> 
!n.isDaemon();
 
     /** Projection factory. */
     @SuppressWarnings("TypeMayBeWeakened")
@@ -194,7 +182,7 @@ class GridClientComputeImpl extends 
GridClientAbstractProjection<GridClientCompu
 
     /** {@inheritDoc} */
     @Override public Collection<GridClientNode> daemonNodes() throws 
GridClientException {
-        return applyFilter(projectionNodes(), DAEMON);
+        return applyFilter(projectionNodes(), GridClientNode::isDaemon);
     }
 
     /** {@inheritDoc} */
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientNodeImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientNodeImpl.java
index d9e0c30..bd59838 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientNodeImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientNodeImpl.java
@@ -23,6 +23,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicReference;
 import org.apache.ignite.internal.client.GridClientCacheMode;
@@ -32,6 +33,9 @@ import org.apache.ignite.internal.client.GridClientProtocol;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.jetbrains.annotations.Nullable;
 
+import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_CLIENT_MODE;
+import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_DAEMON;
+
 /**
  * Client node implementation.
  */
@@ -231,6 +235,16 @@ public class GridClientNodeImpl implements GridClientNode {
     }
 
     /** {@inheritDoc} */
+    @Override public boolean isClient() {
+        return Objects.equals(attribute(ATTR_CLIENT_MODE), true);
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isDaemon() {
+        return "true".equals(attribute(ATTR_DAEMON));
+    }
+
+    /** {@inheritDoc} */
     @Override public int hashCode() {
         return nodeId.hashCode();
     }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/BaselineCommand.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/BaselineCommand.java
index b792d8d..46d4f6e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/BaselineCommand.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/BaselineCommand.java
@@ -87,7 +87,10 @@ public class BaselineCommand implements 
Command<BaselineArguments> {
      */
     @Override public Object execute(GridClientConfiguration clientCfg, Logger 
logger) throws Exception {
         try (GridClient client = Command.startClient(clientCfg)) {
-            UUID coordinatorId = client.compute().nodes().stream()
+            UUID coordinatorId = client.compute()
+                //Only non client node can be coordinator.
+                .nodes(node -> !node.isClient())
+                .stream()
                 .min(Comparator.comparingLong(GridClientNode::order))
                 .map(GridClientNode::nodeId)
                 .orElse(null);
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/CacheCommandList.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/CacheCommandList.java
index 02b95ac..d600a0c 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/CacheCommandList.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/CacheCommandList.java
@@ -45,6 +45,11 @@ public enum CacheCommandList {
     VALIDATE_INDEXES("validate_indexes", new CacheValidateIndexes()),
 
     /**
+     * Check secondary indexes inline size.
+     */
+    CHECK_INDEX_INLINE_SIZES("check_index_inline_sizes", new 
CheckIndexInlineSizes()),
+
+    /**
      * Prints info about contended keys (the keys concurrently locked from 
multiple transactions).
      */
     CONTENTION("contention", new CacheContention()),
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/CacheCommands.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/CacheCommands.java
index 9fe71cd..49ebd118 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/CacheCommands.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/CacheCommands.java
@@ -100,6 +100,7 @@ public class CacheCommands implements 
Command<CacheSubcommands> {
             case FIND_AND_DELETE_GARBAGE:
             case CONTENTION:
             case DISTRIBUTION:
+            case CHECK_INDEX_INLINE_SIZES:
                 cmd.subcommand().parseArguments(argIter);
 
                 break;
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/CacheSubcommands.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/CacheSubcommands.java
index d43bd09..def8c0f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/CacheSubcommands.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/CacheSubcommands.java
@@ -68,7 +68,12 @@ public enum CacheSubcommands {
     /**
      * Find and remove garbage.
      */
-    FIND_AND_DELETE_GARBAGE("find_garbage", FindAndDeleteGarbageArg.class, new 
FindAndDeleteGarbage());
+    FIND_AND_DELETE_GARBAGE("find_garbage", FindAndDeleteGarbageArg.class, new 
FindAndDeleteGarbage()),
+
+    /**
+     * Check secondary indexes inline size.
+     */
+    CHECK_INDEX_INLINE_SIZES("check_index_inline_sizes", null, new 
CheckIndexInlineSizes());
 
     /** Enumerated values. */
     private static final CacheSubcommands[] VALS = values();
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/CheckIndexInlineSizes.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/CheckIndexInlineSizes.java
new file mode 100644
index 0000000..7821d07
--- /dev/null
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/CheckIndexInlineSizes.java
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.commandline.cache;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import java.util.function.Predicate;
+import java.util.logging.Logger;
+import java.util.stream.Collectors;
+import org.apache.ignite.IgniteSystemProperties;
+import org.apache.ignite.internal.client.GridClient;
+import org.apache.ignite.internal.client.GridClientConfiguration;
+import org.apache.ignite.internal.client.GridClientNode;
+import org.apache.ignite.internal.commandline.Command;
+import 
org.apache.ignite.internal.commandline.cache.check_indexes_inline_size.CheckIndexInlineSizesResult;
+import 
org.apache.ignite.internal.commandline.cache.check_indexes_inline_size.CheckIndexInlineSizesTask;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.SB;
+import org.apache.ignite.internal.visor.VisorTaskArgument;
+
+import static java.util.stream.Collectors.toSet;
+import static org.apache.ignite.internal.commandline.CommandLogger.INDENT;
+import static 
org.apache.ignite.internal.commandline.cache.CacheCommands.usageCache;
+
+/**
+ * Command for check secondary indexes inline size on the different nodes.
+ */
+public class CheckIndexInlineSizes implements Command<Void> {
+    /** Success message. */
+    public static final String INDEXES_INLINE_SIZE_ARE_THE_SAME =
+        "All secondary indexes have the same effective inline size on all 
cluster nodes.";
+
+    /** Predicate to filter server nodes. */
+    private static final Predicate<GridClientNode> SRV_NODES = node -> 
!node.isClient() && !node.isDaemon();
+
+    /** {@inheritDoc} */
+    @Override public Object execute(GridClientConfiguration clientCfg, Logger 
log) throws Exception {
+        try (GridClient client = Command.startClient(clientCfg)) {
+            Set<GridClientNode> serverNodes = client.compute().nodes().stream()
+                .filter(SRV_NODES)
+                .collect(toSet());
+
+            Collection<UUID> serverNodeIds = F.transform(serverNodes, 
GridClientNode::nodeId);
+
+            CheckIndexInlineSizesResult res = 
client.compute().projection(serverNodes).execute(
+                CheckIndexInlineSizesTask.class.getName(),
+                new VisorTaskArgument<>(serverNodeIds, false)
+            );
+
+            analyzeResults(log, res);
+        }
+
+        return null;
+    }
+
+    /**
+     * Compares inline sizes from nodes and print to log information about 
"problem" indexes.
+     *
+     * @param log Logger
+     * @param res Indexes inline size.
+     */
+    private void analyzeResults(
+        Logger log,
+        CheckIndexInlineSizesResult res
+    ) {
+        Map<String, Map<Integer, Set<UUID>>> indexToSizeNode = new HashMap<>();
+
+        for (Map.Entry<UUID, Map<String, Integer>> nodeRes : 
res.inlineSizes().entrySet()) {
+            for (Map.Entry<String, Integer> index : 
nodeRes.getValue().entrySet()) {
+                Map<Integer, Set<UUID>> sizeToNodes = 
indexToSizeNode.computeIfAbsent(index.getKey(), x -> new HashMap<>());
+
+                sizeToNodes.computeIfAbsent(index.getValue(), x -> new 
HashSet<>()).add(nodeRes.getKey());
+            }
+        }
+
+        log.info("Found " + indexToSizeNode.size() + " secondary indexes.");
+
+        Map<String, Map<Integer, Set<UUID>>> problems = 
indexToSizeNode.entrySet().stream()
+            .filter(e -> e.getValue().size() > 1)
+            .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
+
+        if (F.isEmpty(problems))
+            log.info(INDEXES_INLINE_SIZE_ARE_THE_SAME);
+        else
+            printProblemsAndShowRecommendations(problems, log);
+    }
+
+    /** */
+    private void printProblemsAndShowRecommendations(Map<String, Map<Integer, 
Set<UUID>>> problems, Logger log) {
+        log.info(problems.size() +
+            " index(es) have different effective inline size on nodes. It can 
lead to performance degradation in SQL queries.");
+        log.info("Index(es):");
+
+        for (Map.Entry<String, Map<Integer, Set<UUID>>> entry : 
problems.entrySet()) {
+            SB sb = new SB();
+
+            sb.a("Full index name: ").a(entry.getKey());
+
+            for (Integer size : entry.getValue().keySet())
+                sb.a(" nodes: ").a(entry.getValue().get(size)).a(" inline 
size: ").a(size).a(",");
+
+            sb.setLength(sb.length() - 1);
+
+            log.info(INDENT + sb);
+        }
+
+        log.info("");
+
+        log.info("Recommendations:");
+        log.info(INDENT + "Check that value of property " + 
IgniteSystemProperties.IGNITE_MAX_INDEX_PAYLOAD_SIZE + " are the same on all 
nodes.");
+        log.info(INDENT + "Recreate indexes (execute DROP INDEX, CREATE INDEX 
commands) with different inline size.");
+    }
+
+    /** {@inheritDoc} */
+    @Override public Void arg() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void printUsage(Logger logger) {
+        usageCache(
+            logger,
+            CacheSubcommands.CHECK_INDEX_INLINE_SIZES,
+            "Checks that secondary indexes inline size are same on the cluster 
nodes.",
+            null
+        );
+    }
+
+    /** {@inheritDoc} */
+    @Override public String name() {
+        return CacheSubcommands.CHECK_INDEX_INLINE_SIZES.text().toUpperCase();
+    }
+}
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/check_indexes_inline_size/CheckIndexInlineSizesResult.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/check_indexes_inline_size/CheckIndexInlineSizesResult.java
new file mode 100644
index 0000000..83d0605
--- /dev/null
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/check_indexes_inline_size/CheckIndexInlineSizesResult.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.commandline.cache.check_indexes_inline_size;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+import org.apache.ignite.internal.dto.IgniteDataTransferObject;
+import org.apache.ignite.internal.processors.task.GridInternal;
+import org.apache.ignite.internal.util.typedef.internal.U;
+
+/**
+ * Represents information about secondary indexes inline size from the cluster 
nodes.
+ */
+@GridInternal
+public class CheckIndexInlineSizesResult extends IgniteDataTransferObject {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Index info (index name, inline size) per node. */
+    private Map<UUID, Map<String, Integer>> nodeToIndexes = new HashMap<>();
+
+    /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws 
IOException {
+        out.writeInt(nodeToIndexes.size());
+
+        for (UUID id : nodeToIndexes.keySet()) {
+            U.writeUuid(out, id);
+
+            U.writeMap(out, nodeToIndexes.get(id));
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(
+        byte protoVer,
+        ObjectInput in
+    ) throws IOException, ClassNotFoundException {
+        int size = in.readInt();
+
+        for (int i = 0; i < size; i++) {
+            UUID id = U.readUuid(in);
+
+            Map<String, Integer> map = U.readMap(in);
+
+            nodeToIndexes.put(id, map);
+        }
+    }
+
+    /**
+     * Adds to result information about indexes from node.
+     *
+     * @param nodeId Node id.
+     * @param indexNameToInlineSize Information about secondary indexes inline 
size.
+     */
+    public void addResult(UUID nodeId, Map<String, Integer> 
indexNameToInlineSize) {
+        Map<String, Integer> prev = nodeToIndexes.put(nodeId, 
indexNameToInlineSize);
+
+        assert prev == null : nodeId + " prev: " + prev + " cur: " + 
indexNameToInlineSize;
+    }
+
+    /**
+     * Merge current result with given instance.
+     *
+     * @param res Given result instance.
+     */
+    public void merge(CheckIndexInlineSizesResult res) {
+        for (Map.Entry<UUID, Map<String, Integer>> entry : 
res.nodeToIndexes.entrySet())
+            addResult(entry.getKey(), entry.getValue());
+    }
+
+    /**
+     * @return Information about secondary indexes inline size from the 
cluster nodes. (nodeId -> (index name, inline size)).
+     */
+    public Map<UUID, Map<String, Integer>> inlineSizes() {
+        return nodeToIndexes;
+    }
+}
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/check_indexes_inline_size/CheckIndexInlineSizesTask.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/check_indexes_inline_size/CheckIndexInlineSizesTask.java
new file mode 100644
index 0000000..7f53ff2
--- /dev/null
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/check_indexes_inline_size/CheckIndexInlineSizesTask.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.commandline.cache.check_indexes_inline_size;
+
+import java.util.List;
+import java.util.Map;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.internal.commandline.cache.CheckIndexInlineSizes;
+import org.apache.ignite.internal.processors.task.GridInternal;
+import org.apache.ignite.internal.visor.VisorJob;
+import org.apache.ignite.internal.visor.VisorMultiNodeTask;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Task for {@link CheckIndexInlineSizes} command.
+ */
+@GridInternal
+public class CheckIndexInlineSizesTask extends VisorMultiNodeTask<Void, 
CheckIndexInlineSizesResult, CheckIndexInlineSizesResult> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override protected VisorJob<Void, CheckIndexInlineSizesResult> job(Void 
arg) {
+        return new CheckIndexInlineSizesJob(arg, debug);
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override protected CheckIndexInlineSizesResult 
reduce0(List<ComputeJobResult> results) {
+        CheckIndexInlineSizesResult res = new CheckIndexInlineSizesResult();
+
+        boolean foundEx = false;
+
+        for (ComputeJobResult jobResult : results) {
+            if (jobResult.getException() == null)
+                res.merge(jobResult.getData());
+            else {
+                foundEx = true;
+
+                break;
+            }
+        }
+
+        if (foundEx) {
+            IgniteException compoundEx = new IgniteException();
+
+            for (ComputeJobResult jobResult : results) {
+                if (jobResult.getException() != null)
+                    compoundEx.addSuppressed(jobResult.getException());
+            }
+
+            throw compoundEx;
+        }
+
+        return res;
+    }
+
+    /**
+     * Job for {@link CheckIndexInlineSizes} command.
+     */
+    private static class CheckIndexInlineSizesJob extends VisorJob<Void, 
CheckIndexInlineSizesResult> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /**
+         * @param arg Argument.
+         * @param debug Debug.
+         */
+        protected CheckIndexInlineSizesJob(@Nullable Void arg, boolean debug) {
+            super(arg, debug);
+        }
+
+        /** {@inheritDoc} */
+        @Override protected CheckIndexInlineSizesResult run(@Nullable Void 
arg) throws IgniteException {
+            Map<String, Integer> indexNameToInlineSize = 
ignite.context().query().secondaryIndexesInlineSize();
+
+            CheckIndexInlineSizesResult res = new 
CheckIndexInlineSizesResult();
+
+            res.addResult(ignite.localNode().id(), indexNameToInlineSize);
+
+            return res;
+        }
+    }
+}
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
index cd18553..d282f4d 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
@@ -19,7 +19,9 @@ package org.apache.ignite.internal.processors.query;
 
 import java.sql.SQLException;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteDataStreamer;
@@ -475,4 +477,14 @@ public interface GridQueryIndexing {
     default long indexSize(String schemaName, String tblName, String idxName) 
throws IgniteCheckedException {
         return 0;
     }
+
+    /**
+     * Information about secondary indexes efficient (actual) inline size.
+     *
+     * @return Map with inline sizes. The key of entry is a full index name 
(with schema and table name), the value of
+     * entry is a inline size.
+     */
+    default Map<String, Integer> secondaryIndexesInlineSize() {
+        return Collections.emptyMap();
+    }
 }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index b22169b..8a94782 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.query;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -113,6 +114,7 @@ import org.apache.ignite.internal.util.typedef.T3;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.LT;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.lang.IgniteFuture;
@@ -139,6 +141,12 @@ import static 
org.apache.ignite.internal.processors.query.schema.SchemaOperation
  * Indexing processor.
  */
 public class GridQueryProcessor extends GridProcessorAdapter {
+    /** */
+    private static final String INLINE_SIZES_DISCO_BAG_KEY = "inline_sizes";
+
+    /** Warn message if some indexes have different inline sizes on the nodes. 
*/
+    public static final String INLINE_SIZES_DIFFER_WARN_MSG_FORMAT = "Inline 
sizes on local node and node %s are different. Please drop and create again 
these indexes to avoid performance problems with SQL queries. Problem indexes: 
%s";
+
     /** Queries detail metrics eviction frequency. */
     private static final int QRY_DETAIL_METRICS_EVICTION_FREQ = 3_000;
 
@@ -343,27 +351,136 @@ public class GridQueryProcessor extends 
GridProcessorAdapter {
 
     /** {@inheritDoc} */
     @Override public void collectGridNodeData(DiscoveryDataBag dataBag) {
+        LinkedHashMap<UUID, SchemaProposeDiscoveryMessage> proposals;
+
         // Collect active proposals.
         synchronized (stateMux) {
-            LinkedHashMap<UUID, SchemaProposeDiscoveryMessage> data = new 
LinkedHashMap<>(activeProposals);
+            proposals = new LinkedHashMap<>(activeProposals);
+        }
+
+        
dataBag.addGridCommonData(DiscoveryDataExchangeType.QUERY_PROC.ordinal(), 
proposals);
+
+        // We should send inline index sizes information only to server nodes, 
but we can't distinguish easily daemon
+        // node from server node.
+        if (!dataBag.isJoiningNodeClient()) {
+            HashMap<String, Serializable> nodeSpecificMap = new HashMap<>();
+
+            Serializable oldVal = 
nodeSpecificMap.put(INLINE_SIZES_DISCO_BAG_KEY, 
collectSecondaryIndexesInlineSize());
+
+            assert oldVal == null : oldVal;
+
+            
dataBag.addNodeSpecificData(DiscoveryDataExchangeType.QUERY_PROC.ordinal(), 
nodeSpecificMap);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void 
onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data) {
+        if (data.hasJoiningNodeData() && data.joiningNodeData() instanceof 
Map) {
+            Map<String, Serializable> nodeSpecificDataMap = (Map<String, 
Serializable>)data.joiningNodeData();
+
+            if (nodeSpecificDataMap.containsKey(INLINE_SIZES_DISCO_BAG_KEY)) {
+                Serializable serializable = 
nodeSpecificDataMap.get(INLINE_SIZES_DISCO_BAG_KEY);
+
+                assert serializable instanceof Map : serializable;
+
+                Map<String, Integer> joiningNodeIndexesInlineSize = 
(Map<String, Integer>)serializable;
 
-            
dataBag.addGridCommonData(DiscoveryDataExchangeType.QUERY_PROC.ordinal(), data);
+                checkInlineSizes(secondaryIndexesInlineSize(), 
joiningNodeIndexesInlineSize, data.joiningNodeId());
+            }
         }
     }
 
     /** {@inheritDoc} */
+    @Override public void collectJoiningNodeData(DiscoveryDataBag dataBag) {
+        HashMap<String, Serializable> dataMap = new HashMap<>();
+
+        dataMap.put(INLINE_SIZES_DISCO_BAG_KEY, 
collectSecondaryIndexesInlineSize());
+
+        
dataBag.addJoiningNodeData(DiscoveryDataExchangeType.QUERY_PROC.ordinal(), 
dataMap);
+    }
+
+    /** {@inheritDoc} */
     @Override public void 
onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data) {
-        synchronized (stateMux) {
-            // Preserve proposals.
-            LinkedHashMap<UUID, SchemaProposeDiscoveryMessage> data0 =
-                (LinkedHashMap<UUID, 
SchemaProposeDiscoveryMessage>)data.commonData();
+        // Preserve proposals.
+        LinkedHashMap<UUID, SchemaProposeDiscoveryMessage> activeProposals =
+            (LinkedHashMap<UUID, 
SchemaProposeDiscoveryMessage>)data.commonData();
 
-            // Process proposals as if they were received as regular discovery 
messages.
-            if (data0 != null) {
-                for (SchemaProposeDiscoveryMessage activeProposal : 
data0.values())
+        // Process proposals as if they were received as regular discovery 
messages.
+        if (!F.isEmpty(activeProposals)) {
+            synchronized (stateMux) {
+                for (SchemaProposeDiscoveryMessage activeProposal : 
activeProposals.values())
                     onSchemaProposeDiscovery0(activeProposal);
             }
         }
+
+        if (!F.isEmpty(data.nodeSpecificData())) {
+            Map<String, Integer> indexesInlineSize = 
secondaryIndexesInlineSize();
+
+            if (!F.isEmpty(indexesInlineSize)) {
+                for (UUID nodeId : data.nodeSpecificData().keySet()) {
+                    Serializable serializable = 
data.nodeSpecificData().get(nodeId);
+
+                    assert serializable instanceof Map : serializable;
+
+                    Map<String, Serializable> nodeSpecificData = (Map<String, 
Serializable>)serializable;
+
+                    if 
(nodeSpecificData.containsKey(INLINE_SIZES_DISCO_BAG_KEY))
+                        checkInlineSizes(indexesInlineSize, (Map<String, 
Integer>)nodeSpecificData.get(INLINE_SIZES_DISCO_BAG_KEY), nodeId);
+                }
+            }
+        }
+    }
+
+    /**
+     *
+     * @return Information about secondary indexes inline size. Key is a full 
index name, value is a effective inline size.
+     * @see GridQueryIndexing#secondaryIndexesInlineSize()
+     */
+    public Map<String, Integer> secondaryIndexesInlineSize() {
+        return idx != null ? idx.secondaryIndexesInlineSize() : 
Collections.emptyMap();
+    }
+
+    /**
+     * Compares indexes inline size on remote and local and fires warn 
message, if difference found.
+     *
+     * @param local Information about indexes inline size on local node.
+     * @param remote Information about indexes inline size on remote node.
+     * @param remoteNodeId Remote node id.
+     */
+    private void checkInlineSizes(Map<String, Integer> local, Map<String, 
Integer> remote, UUID remoteNodeId) {
+        if (log.isDebugEnabled())
+            log.debug("Check inline sizes on remote node with node id: " + 
remoteNodeId + ". Local: " + local + ", remote: " + remote);
+
+        if (F.isEmpty(local) || F.isEmpty(remote))
+            return;
+
+        SB sb = new SB();
+
+        for (String indexFullname : local.keySet()) {
+            if (remote.containsKey(indexFullname)) {
+                int localInlineSize = local.get(indexFullname);
+                int remoteInlineSize = remote.get(indexFullname);
+
+                if (localInlineSize != remoteInlineSize)
+                    
sb.a(indexFullname).a("(").a(localInlineSize).a(",").a(remoteInlineSize).a(")").a(",");
+            }
+        }
+
+        if (sb.length() > 0) {
+            sb.setLength(sb.length() - 1);
+
+            log.warning(String.format(INLINE_SIZES_DIFFER_WARN_MSG_FORMAT, 
remoteNodeId, sb));
+        }
+    }
+
+    /**
+     * @return Serializable information about secondary indexes inline size.
+     * @see #secondaryIndexesInlineSize()
+     */
+    private Serializable collectSecondaryIndexesInlineSize() {
+        Map<String, Integer> map = secondaryIndexesInlineSize();
+
+        return map instanceof Serializable ? (Serializable)map : new 
HashMap<>(map);
     }
 
     /**
@@ -797,7 +914,7 @@ public class GridQueryProcessor extends 
GridProcessorAdapter {
                                     SchemaAbstractOperation op0 = 
op.proposeMessage().operation();
 
                                     if (op0 instanceof 
SchemaIndexCreateOperation) {
-                                        SchemaIndexCreateOperation opCreate = 
(SchemaIndexCreateOperation) op0;
+                                        SchemaIndexCreateOperation opCreate = 
(SchemaIndexCreateOperation)op0;
 
                                         QueryTypeDescriptorImpl typeDesc = 
tblTypMap.get(opCreate.tableName());
 
@@ -807,7 +924,7 @@ public class GridQueryProcessor extends 
GridProcessorAdapter {
                                             typeDesc);
                                     }
                                     else if (op0 instanceof 
SchemaIndexDropOperation) {
-                                        SchemaIndexDropOperation opDrop = 
(SchemaIndexDropOperation) op0;
+                                        SchemaIndexDropOperation opDrop = 
(SchemaIndexDropOperation)op0;
 
                                         QueryTypeDescriptorImpl typeDesc = 
idxTypMap.get(opDrop.indexName());
 
@@ -1098,7 +1215,7 @@ public class GridQueryProcessor extends 
GridProcessorAdapter {
         String cacheName = op.cacheName();
 
         if (op instanceof SchemaIndexCreateOperation) {
-            SchemaIndexCreateOperation op0 = (SchemaIndexCreateOperation) op;
+            SchemaIndexCreateOperation op0 = (SchemaIndexCreateOperation)op;
 
             QueryIndex idx = op0.index();
 
@@ -1136,7 +1253,7 @@ public class GridQueryProcessor extends 
GridProcessorAdapter {
             }
         }
         else if (op instanceof SchemaIndexDropOperation) {
-            SchemaIndexDropOperation op0 = (SchemaIndexDropOperation) op;
+            SchemaIndexDropOperation op0 = (SchemaIndexDropOperation)op;
 
             String idxName = op0.indexName();
 
@@ -1513,7 +1630,7 @@ public class GridQueryProcessor extends 
GridProcessorAdapter {
                     idxs.put(idxKey, idxDesc);
                 }
                 else if (op instanceof SchemaIndexDropOperation) {
-                    SchemaIndexDropOperation op0 = (SchemaIndexDropOperation) 
op;
+                    SchemaIndexDropOperation op0 = 
(SchemaIndexDropOperation)op;
 
                     QueryUtils.processDynamicIndexChange(op0.indexName(), 
null, type);
 
@@ -2455,13 +2572,13 @@ public class GridQueryProcessor extends 
GridProcessorAdapter {
                         GridQueryCancel cancel0 = cancel != null ? cancel : 
new GridQueryCancel();
 
                         List<FieldsQueryCursor<List<?>>> res = 
idx.querySqlFields(
-                                schemaName,
-                                qry,
-                                cliCtx,
-                                keepBinary,
-                                failOnMultipleStmts,
-                                cancel0
-                            );
+                            schemaName,
+                            qry,
+                            cliCtx,
+                            keepBinary,
+                            failOnMultipleStmts,
+                            cancel0
+                        );
 
                         if (cctx != null)
                             sendQueryExecutedEvent(qry.getSql(), 
qry.getArgs(), cctx, qryType);
@@ -2588,8 +2705,8 @@ public class GridQueryProcessor extends 
GridProcessorAdapter {
      * @param keepBinary Keep binary flag.
      * @return Cursor.
      */
-    public <K, V> QueryCursor<Cache.Entry<K,V>> querySql(
-        final GridCacheContext<?,?> cctx,
+    public <K, V> QueryCursor<Cache.Entry<K, V>> querySql(
+        final GridCacheContext<?, ?> cctx,
         final SqlQuery qry,
         boolean keepBinary
     ) {
@@ -2769,10 +2886,11 @@ public class GridQueryProcessor extends 
GridProcessorAdapter {
      * @param qryType actual query type, usually either SQL or SQL_FIELDS.
      */
     private void sendQueryExecutedEvent(
-            String sqlQry,
-            Object[] params,
-            GridCacheContext<?, ?> cctx,
-            GridCacheQueryType qryType) {
+        String sqlQry,
+        Object[] params,
+        GridCacheContext<?, ?> cctx,
+        GridCacheQueryType qryType
+    ) {
         if (cctx.events().isRecordable(EVT_CACHE_QUERY_EXECUTED)) {
             ctx.event().record(new CacheQueryExecutedEvent<>(
                 ctx.discovery().localNode(),
@@ -3339,10 +3457,10 @@ public class GridQueryProcessor extends 
GridProcessorAdapter {
                             // thread under load. Hence, moving short-lived 
operation to separate worker.
                             new IgniteThread(ctx.igniteInstanceName(), 
"schema-circuit-breaker-" + op.id(),
                                 new Runnable() {
-                                @Override public void run() {
-                                    onSchemaPropose(nextOp.proposeMessage());
-                                }
-                            }).start();
+                                    @Override public void run() {
+                                        
onSchemaPropose(nextOp.proposeMessage());
+                                    }
+                                }).start();
                         }
                     }
                 }
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties 
b/modules/core/src/main/resources/META-INF/classnames.properties
index 3772c76..747fbaf 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -346,6 +346,9 @@ 
org.apache.ignite.internal.commandline.cache.argument.FindAndDeleteGarbageArg
 org.apache.ignite.internal.commandline.cache.argument.IdleVerifyCommandArg
 org.apache.ignite.internal.commandline.cache.argument.ListCommandArg
 org.apache.ignite.internal.commandline.cache.argument.ValidateIndexesCommandArg
+org.apache.ignite.internal.commandline.cache.check_indexes_inline_size.CheckIndexInlineSizesResult
+org.apache.ignite.internal.commandline.cache.check_indexes_inline_size.CheckIndexInlineSizesTask
+org.apache.ignite.internal.commandline.cache.check_indexes_inline_size.CheckIndexInlineSizesTask.CheckIndexInlineSizesJob
 
org.apache.ignite.internal.commandline.cache.distribution.CacheDistributionGroup
 org.apache.ignite.internal.commandline.cache.distribution.CacheDistributionNode
 
org.apache.ignite.internal.commandline.cache.distribution.CacheDistributionPartition
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/client/thin/ComputeTaskTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/client/thin/ComputeTaskTest.java
index c28b473..5cc4f10 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/client/thin/ComputeTaskTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/client/thin/ComputeTaskTest.java
@@ -490,7 +490,7 @@ public class ComputeTaskTest extends GridCommonAbstractTest 
{
             GridTestUtils.runMultiThreaded(
                 () -> {
                     int threadIdx = threadIdxs.incrementAndGet();
-                    
+
                     Random rnd = new Random();
 
                     try {
@@ -498,13 +498,13 @@ public class ComputeTaskTest extends 
GridCommonAbstractTest {
 
                         for (int i = 0; i < iterations; i++) {
                             int nodeIdx = rnd.nextInt(GRIDS_CNT);
-                            
+
                             cache.put(threadIdx, i);
-                            
+
                             ClientCompute compute = 
client.compute(client.cluster().forNodeId(nodeId(nodeIdx)));
-                            
+
                             Future<T2<UUID, Set<UUID>>> fut = 
compute.executeAsync(TestTask.class.getName(), null);
-                            
+
                             assertEquals((Integer)i, cache.get(threadIdx));
 
                             assertEquals(nodeIds(nodeIdx), fut.get().get2());
@@ -518,7 +518,7 @@ public class ComputeTaskTest extends GridCommonAbstractTest 
{
                     catch (InterruptedException | BrokenBarrierException 
ignore) {
                         // No-op.
                     }
-                    
+
                 }, threadsCnt, "run-task-async");
 
             
assertTrue(((ClientComputeImpl)client.compute()).activeTaskFutures().isEmpty());
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 949ec4e..da422af 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
@@ -1251,7 +1251,7 @@ public abstract class GridAbstractTest extends 
JUnitAssertAware {
      * @return Additional JVM args for remote instances.
      */
     protected List<String> additionalRemoteJvmArgs() {
-        return Collections.emptyList();
+        return new ArrayList<>();
     }
 
     /**
diff --git 
a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
 
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
index 636f810..1f64f4c 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
@@ -128,7 +128,7 @@ public class IgniteProcessProxy implements IgniteEx {
     private final transient IgniteLogger log;
 
     /** Grid id. */
-    private final UUID id = UUID.randomUUID();
+    private final UUID id;
 
     /**
      * @param cfg Configuration.
@@ -168,6 +168,7 @@ public class IgniteProcessProxy implements IgniteEx {
     )
         throws Exception {
         this.cfg = cfg;
+        this.id = cfg.getNodeId() == null ? UUID.randomUUID() : 
cfg.getNodeId();
         this.locJvmGrid = locJvmGrid;
         this.log = logger(log, "jvm-" + id.toString().substring(0, 
id.toString().indexOf('-')));
 
diff --git 
a/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassTest_cache_help.output
 
b/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassTest_cache_help.output
index f5518c3..1a97423 100644
--- 
a/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassTest_cache_help.output
+++ 
b/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassTest_cache_help.output
@@ -38,6 +38,9 @@ Arguments: --cache help --yes
       --check-crc        - check the CRC-sum of pages stored on disk
       --check-sizes      - check that index size and cache size are the same
 
+  --cache check_index_inline_sizes
+    Checks that secondary indexes inline size are same on the cluster nodes.
+
   --cache contention minQueueSize [nodeId] [maxPrint]
     Show the keys that are point of contention for multiple transactions.
 
diff --git 
a/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassWithSSLTest_cache_help.output
 
b/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassWithSSLTest_cache_help.output
index f5518c3..1a97423 100644
--- 
a/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassWithSSLTest_cache_help.output
+++ 
b/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassWithSSLTest_cache_help.output
@@ -38,6 +38,9 @@ Arguments: --cache help --yes
       --check-crc        - check the CRC-sum of pages stored on disk
       --check-sizes      - check that index size and cache size are the same
 
+  --cache check_index_inline_sizes
+    Checks that secondary indexes inline size are same on the cluster nodes.
+
   --cache contention minQueueSize [nodeId] [maxPrint]
     Show the keys that are point of contention for multiple transactions.
 
diff --git 
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
 
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 5b85881..626e21a 100644
--- 
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ 
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -26,6 +26,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
@@ -118,6 +119,7 @@ import 
org.apache.ignite.internal.processors.query.h2.affinity.H2PartitionResolv
 import 
org.apache.ignite.internal.processors.query.h2.affinity.PartitionExtractor;
 import 
org.apache.ignite.internal.processors.query.h2.database.H2TreeClientIndex;
 import org.apache.ignite.internal.processors.query.h2.database.H2TreeIndex;
+import org.apache.ignite.internal.processors.query.h2.database.H2TreeIndexBase;
 import 
org.apache.ignite.internal.processors.query.h2.database.io.H2ExtrasInnerIO;
 import 
org.apache.ignite.internal.processors.query.h2.database.io.H2ExtrasLeafIO;
 import org.apache.ignite.internal.processors.query.h2.database.io.H2InnerIO;
@@ -180,6 +182,7 @@ import org.h2.api.ErrorCode;
 import org.h2.api.JavaObjectSerializer;
 import org.h2.engine.Session;
 import org.h2.engine.SysProperties;
+import org.h2.index.Index;
 import org.h2.table.Column;
 import org.h2.table.IndexColumn;
 import org.h2.table.TableType;
@@ -3105,4 +3108,18 @@ public class IgniteH2Indexing implements 
GridQueryIndexing {
     public DistributedSqlConfiguration distributedConfiguration() {
         return distrCfg;
     }
+
+    /** {@inheritDoc} */
+    @Override public Map<String, Integer> secondaryIndexesInlineSize() {
+        Map<String, Integer> map = new HashMap<>();
+        for (GridH2Table table : schemaMgr.dataTables()) {
+            for (Index index : table.getIndexes()) {
+                if (index instanceof H2TreeIndexBase && 
!index.getIndexType().isPrimaryKey())
+                    map.put(index.getSchema().getName() + "#" + 
index.getTable().getName() + "#" + index.getName(), 
((H2TreeIndexBase)index).inlineSize());
+            }
+
+        }
+
+        return map;
+    }
 }
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CheckIndexesInlineSizeOnNodeJoinMultiJvmTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CheckIndexesInlineSizeOnNodeJoinMultiJvmTest.java
new file mode 100644
index 0000000..3dd4be6
--- /dev/null
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CheckIndexesInlineSizeOnNodeJoinMultiJvmTest.java
@@ -0,0 +1,245 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+import java.util.stream.Stream;
+import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.failure.StopNodeOrHaltFailureHandler;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.testframework.ListeningTestLogger;
+import org.apache.ignite.testframework.LogListener;
+import org.apache.ignite.testframework.junits.WithSystemProperty;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+import static java.lang.String.format;
+import static 
org.apache.ignite.IgniteSystemProperties.IGNITE_MAX_INDEX_PAYLOAD_SIZE;
+import static 
org.apache.ignite.internal.processors.query.GridQueryProcessor.INLINE_SIZES_DIFFER_WARN_MSG_FORMAT;
+
+/**
+ * Checks that node prints warn message on join node, if indexes inlize size 
are different on the nodes.
+ */
+@WithSystemProperty(key = IGNITE_MAX_INDEX_PAYLOAD_SIZE, value = "1")
+public class CheckIndexesInlineSizeOnNodeJoinMultiJvmTest extends 
GridCommonAbstractTest {
+    /** */
+    private static final String STR = 
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+    /** */
+    private static final String INDEXES_WARN_MSG_FORMAT = 
"PUBLIC#TEST_TABLE#L_IDX(%d,%d),PUBLIC#TEST_TABLE#S1_IDX(%d,%d),PUBLIC#TEST_TABLE#I_IDX(%d,%d)";
+
+    /** Nodes count. */
+    private static final int NODES_CNT = 3;
+
+    /** Max payload inline index size for local node. */
+    private static final int INITIAL_PAYLOAD_SIZE = 1;
+
+    /** */
+    private ListeningTestLogger testLog;
+
+    /** Max payload inline index size. */
+    private int payloadSize;
+
+    /** */
+    private UUID nodeId;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String 
igniteInstanceName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName)
+            .setConsistentId(igniteInstanceName)
+            .setFailureHandler(new StopNodeOrHaltFailureHandler())
+            .setDataStorageConfiguration(new DataStorageConfiguration()
+                .setDefaultDataRegionConfiguration(new 
DataRegionConfiguration().setPersistenceEnabled(true))
+            );
+
+        if (!isRemoteJvm(igniteInstanceName))
+            cfg.setGridLogger(testLog);
+
+        if (nodeId != null)
+            cfg.setNodeId(nodeId);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        super.beforeTest();
+
+        stopAllGrids();
+
+        cleanPersistenceDir();
+
+        assertEquals(INITIAL_PAYLOAD_SIZE, 
Integer.parseInt(System.getProperty(IGNITE_MAX_INDEX_PAYLOAD_SIZE)));
+
+        testLog = new ListeningTestLogger(false, log);
+
+        startGrids(NODES_CNT).cluster().active(true);
+
+        for (Map.Entry<String, Object[]> entry : getSqlStatements().entrySet())
+            executeSql(grid(0), entry.getKey(), entry.getValue());
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        stopAllGrids();
+
+        cleanPersistenceDir();
+
+        super.afterTest();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected boolean isMultiJvm() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected List<String> additionalRemoteJvmArgs() {
+        List<String> args = super.additionalRemoteJvmArgs();
+
+        args.add("-D" + IGNITE_MAX_INDEX_PAYLOAD_SIZE + "=" + payloadSize);
+
+        return args;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteEx startGrid(int idx) throws Exception {
+        payloadSize = getMaxPayloadSize(idx);
+
+        return super.startGrid(idx);
+    }
+
+    /**
+     * Checks that warn messages are presented in the logs on joining node.
+     *
+     * @throws Exception If something goes wrong.
+     */
+    @Test
+    public void testWarnOnJoiningNode() throws Exception {
+        performTestScenario(0);
+    }
+
+    /**
+     * Checks that warn messages are presented in the logs on the nodes in 
cluster.
+     *
+     * @throws Exception If something goes wrong.
+     */
+    @Test
+    public void testWarnOnNodeInCluster() throws Exception {
+        performTestScenario(1);
+    }
+
+    /**
+     * Restarts node with given index and check messages in the log after node 
restart.
+     *
+     * @param restartNodeIdx Index of restarting node.
+     * @throws Exception If something goes wrong.
+     */
+    private void performTestScenario(int restartNodeIdx) throws Exception {
+        assertTrue("Wrong restart node index: " + restartNodeIdx, 
restartNodeIdx >= 0 && restartNodeIdx < NODES_CNT);
+
+        Map<Integer, UUID> nodeIdxToNodeId =
+            IntStream.range(0, NODES_CNT).boxed().collect(Collectors.toMap(i 
-> i, i -> grid(i).localNode().id()));
+
+        stopGrid(restartNodeIdx);
+
+        nodeId = UUID.randomUUID();
+
+        nodeIdxToNodeId.put(restartNodeIdx, nodeId);
+
+        Collection<LogListener> listeners = registerListeners(restartNodeIdx, 
nodeIdxToNodeId);
+
+        assertFalse(F.isEmpty(listeners));
+
+        startGrid(restartNodeIdx);
+
+        awaitPartitionMapExchange();
+
+        for (LogListener listener : listeners)
+            assertTrue(listener.toString(), listener.check());
+    }
+
+    /** */
+    private Collection<LogListener> registerListeners(int restartNodeIdx, 
Map<Integer, UUID> nodeIdxToNodeId) {
+        List<String> msgs = new ArrayList<>(NODES_CNT - 1);
+
+        int payloadSize = getMaxPayloadSize(restartNodeIdx);
+
+        if (restartNodeIdx == 0) {
+            for (Integer idx : nodeIdxToNodeId.keySet()) {
+                if (idx != 0)
+                    
msgs.add(generateIndexesWarnMessage(nodeIdxToNodeId.get(idx), payloadSize, 
getMaxPayloadSize(idx)));
+            }
+        }
+        else
+            
msgs.add(generateIndexesWarnMessage(nodeIdxToNodeId.get(restartNodeIdx), 
getMaxPayloadSize(0), payloadSize));
+
+        Collection<LogListener> listeners = msgs.stream().map(m -> 
LogListener.matches(m).build()).collect(Collectors.toList());
+
+        listeners.forEach(l -> testLog.registerListener(l));
+
+        return listeners;
+    }
+
+    /** */
+    private String generateIndexesWarnMessage(UUID nodeId, int payloadSize1, 
int payloadSize2) {
+        String indexesInfo = format(INDEXES_WARN_MSG_FORMAT, payloadSize1, 
payloadSize2, payloadSize1, payloadSize2, payloadSize1, payloadSize2);
+
+        return format(INLINE_SIZES_DIFFER_WARN_MSG_FORMAT, nodeId, 
indexesInfo);
+    }
+
+    /** */
+    private int getMaxPayloadSize(int nodeId) {
+        return INITIAL_PAYLOAD_SIZE + nodeId;
+    }
+
+    /** */
+    private static List<List<?>> executeSql(IgniteEx node, String stmt, 
Object... args) {
+        return node.context().query().querySqlFields(new 
SqlFieldsQuery(stmt).setArgs(args), true).getAll();
+    }
+
+    /** */
+    public static Map<String, Object[]> getSqlStatements() {
+        Object[] EMPTY = new Object[0];
+
+        Map<String, Object[]> stmts = new LinkedHashMap<>();
+
+        stmts.put("CREATE TABLE TEST_TABLE (i INT, l LONG, s0 VARCHAR, s1 
VARCHAR, PRIMARY KEY (i, s0)) WITH \"backups=1\"", EMPTY);
+
+        for (int i = 0; i < 10; i++)
+            stmts.put("INSERT INTO TEST_TABLE (i, l, s0, s1) VALUES (?, ?, ?, 
?)", Stream.of(i, i * i, STR + i, STR + i * i).toArray());
+
+        stmts.put("CREATE INDEX i_idx ON TEST_TABLE(i)", EMPTY);
+        stmts.put("CREATE INDEX l_idx ON TEST_TABLE(l)", EMPTY);
+        stmts.put("CREATE INDEX s0_idx ON TEST_TABLE(s0) INLINE_SIZE 10", 
EMPTY);
+        stmts.put("CREATE INDEX s1_idx ON TEST_TABLE(s1)", EMPTY);
+
+        return stmts;
+    }
+}
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java
 
b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java
index 2067648..739f915 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java
@@ -40,6 +40,7 @@ import 
org.apache.ignite.internal.processors.cache.CacheReplicatedQueryDetailMet
 import 
org.apache.ignite.internal.processors.cache.CacheReplicatedQueryMetricsDistributedSelfTest;
 import 
org.apache.ignite.internal.processors.cache.CacheReplicatedQueryMetricsLocalSelfTest;
 import 
org.apache.ignite.internal.processors.cache.CacheSqlQueryValueCopySelfTest;
+import 
org.apache.ignite.internal.processors.cache.CheckIndexesInlineSizeOnNodeJoinMultiJvmTest;
 import org.apache.ignite.internal.processors.cache.DdlTransactionSelfTest;
 import 
org.apache.ignite.internal.processors.cache.GridCacheCrossCacheQuerySelfTest;
 import 
org.apache.ignite.internal.processors.cache.GridCacheDynamicLoadOnClientPersistentTest;
@@ -530,6 +531,7 @@ import org.junit.runners.Suite;
 
     GridIndexRebuildSelfTest.class,
     GridIndexFullRebuildTest.class,
+    CheckIndexesInlineSizeOnNodeJoinMultiJvmTest.class,
 
     SqlTransactionCommandsWithMvccDisabledSelfTest.class,
 
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingAndPersistenceTestSuite.java
 
b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingAndPersistenceTestSuite.java
index 309f784..9bca9c2 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingAndPersistenceTestSuite.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingAndPersistenceTestSuite.java
@@ -20,6 +20,7 @@ package org.apache.ignite.testsuites;
 import org.apache.ignite.internal.processors.cache.StartCachesInParallelTest;
 import 
org.apache.ignite.internal.processors.cache.index.IoStatisticsBasicIndexSelfTest;
 import org.apache.ignite.util.GridCommandHandlerBrokenIndexTest;
+import org.apache.ignite.util.GridCommandHandlerCheckIndexesInlineSizeTest;
 import org.apache.ignite.util.GridCommandHandlerIndexingCheckSizeTest;
 import org.apache.ignite.util.GridCommandHandlerIndexingClusterByClassTest;
 import 
org.apache.ignite.util.GridCommandHandlerIndexingClusterByClassWithSSLTest;
@@ -39,6 +40,7 @@ import org.junit.runners.Suite;
     GridCommandHandlerIndexingClusterByClassTest.class,
     GridCommandHandlerIndexingClusterByClassWithSSLTest.class,
     GridCommandHandlerIndexingCheckSizeTest.class,
+    GridCommandHandlerCheckIndexesInlineSizeTest.class,
     StartCachesInParallelTest.class,
     IoStatisticsBasicIndexSelfTest.class
 })
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/util/GridCommandHandlerCheckIndexesInlineSizeTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/util/GridCommandHandlerCheckIndexesInlineSizeTest.java
new file mode 100644
index 0000000..de33ac6
--- /dev/null
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/util/GridCommandHandlerCheckIndexesInlineSizeTest.java
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.util;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.testframework.junits.WithSystemProperty;
+import org.junit.Test;
+
+import static java.lang.String.format;
+import static 
org.apache.ignite.IgniteSystemProperties.IGNITE_MAX_INDEX_PAYLOAD_SIZE;
+import static 
org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK;
+import static 
org.apache.ignite.internal.processors.cache.CheckIndexesInlineSizeOnNodeJoinMultiJvmTest.getSqlStatements;
+import static org.apache.ignite.testframework.GridTestUtils.assertContains;
+
+/**
+ * Checks utility output if check_index_inline_sizes command found problems.
+ */
+@WithSystemProperty(key = IGNITE_MAX_INDEX_PAYLOAD_SIZE, value = "1")
+public class GridCommandHandlerCheckIndexesInlineSizeTest extends 
GridCommandHandlerAbstractTest {
+    /** */
+    private static final String INDEX_PROBLEM_FMT =
+        "Full index name: PUBLIC#TEST_TABLE#%s nodes: [%s] inline size: 1, 
nodes: [%s] inline size: 2";
+
+    /** Nodes count. */
+    private static final int NODES_CNT = 2;
+
+    /** Max payload inline index size for local node. */
+    private static final int INITIAL_PAYLOAD_SIZE = 1;
+
+    /** Max payload inline index size. */
+    private int payloadSize;
+
+    /** */
+    private static final UUID remoteNodeId = UUID.randomUUID();
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String 
igniteInstanceName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+        if (isRemoteJvm(igniteInstanceName))
+            cfg.setNodeId(remoteNodeId);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        super.beforeTestsStarted();
+
+        stopAllGrids();
+
+        cleanPersistenceDir();
+
+        assertEquals(INITIAL_PAYLOAD_SIZE, 
Integer.parseInt(System.getProperty(IGNITE_MAX_INDEX_PAYLOAD_SIZE)));
+
+        startGrids(NODES_CNT).cluster().active(true);
+
+        for (Map.Entry<String, Object[]> entry : getSqlStatements().entrySet())
+            executeSql(grid(0), entry.getKey(), entry.getValue());
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+
+        cleanPersistenceDir();
+
+        super.afterTestsStopped();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected boolean isMultiJvm() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected List<String> additionalRemoteJvmArgs() {
+        List<String> args = super.additionalRemoteJvmArgs();
+
+        args.add("-D" + IGNITE_MAX_INDEX_PAYLOAD_SIZE + "=" + payloadSize);
+
+        return args;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteEx startGrid(int idx) throws Exception {
+        payloadSize = getMaxPayloadSize(idx);
+
+        return super.startGrid(idx);
+    }
+
+    /**
+     * See class description.
+     */
+    @Test
+    public void test() {
+        injectTestSystemOut();
+
+        assertEquals(EXIT_CODE_OK, execute("--cache", 
"check_index_inline_sizes"));
+
+        checkUtilityOutput(log, testOut.toString(), grid(0).localNode().id(), 
remoteNodeId);
+    }
+
+    /** */
+    private int getMaxPayloadSize(int nodeId) {
+        return INITIAL_PAYLOAD_SIZE + nodeId;
+    }
+
+    /** */
+    private static List<List<?>> executeSql(IgniteEx node, String stmt, 
Object... args) {
+        return node.context().query().querySqlFields(new 
SqlFieldsQuery(stmt).setArgs(args), true).getAll();
+    }
+
+    /**
+     * Checks that control.sh output as expected.
+     *
+     * @param log Logger.
+     * @param output Uitlity output.
+     * @param localNodeId Local node id.
+     * @param remoteNodeId Remote node id.
+     */
+    public static void checkUtilityOutput(IgniteLogger log, String output, 
UUID localNodeId, UUID remoteNodeId) {
+        assertContains(log, output, "Found 4 secondary indexes.");
+        assertContains(log, output, "3 index(es) have different effective 
inline size on nodes. It can lead to performance degradation in SQL queries.");
+        assertContains(log, output, "Index(es):");
+        assertContains(log, output, format(INDEX_PROBLEM_FMT, "L_IDX", 
localNodeId, remoteNodeId));
+        assertContains(log, output, format(INDEX_PROBLEM_FMT, "S1_IDX", 
localNodeId, remoteNodeId));
+        assertContains(log, output, format(INDEX_PROBLEM_FMT, "I_IDX", 
localNodeId, remoteNodeId));
+        assertContains(log, output, "  Check that value of property 
IGNITE_MAX_INDEX_PAYLOAD_SIZE are the same on all nodes.");
+        assertContains(log, output, "  Recreate indexes (execute DROP INDEX, 
CREATE INDEX commands) with different inline size.");
+    }
+}
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexingClusterByClassTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexingClusterByClassTest.java
index 4b2b8ab..f85c0e2 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexingClusterByClassTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexingClusterByClassTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.util;
 import org.junit.Test;
 
 import static 
org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK;
+import static 
org.apache.ignite.internal.commandline.cache.CheckIndexInlineSizes.INDEXES_INLINE_SIZE_ARE_THE_SAME;
 import static org.apache.ignite.testframework.GridTestUtils.assertContains;
 import static 
org.apache.ignite.util.GridCommandHandlerIndexingUtils.breakCacheDataTree;
 import static 
org.apache.ignite.util.GridCommandHandlerIndexingUtils.breakSqlIndex;
@@ -42,6 +43,21 @@ public class GridCommandHandlerIndexingClusterByClassTest 
extends GridCommandHan
     }
 
     /**
+     * Tests --cache check_index_inline_sizes works in case of all indexes 
have the same inline size.
+     */
+    @Test
+    public void testCheckIndexInlineSizesNoError() {
+        injectTestSystemOut();
+
+        assertEquals(EXIT_CODE_OK, execute("--cache", 
"check_index_inline_sizes"));
+
+        String output = testOut.toString();
+
+        assertContains(log, output, "Found 2 secondary indexes.");
+        assertContains(log, output, INDEXES_INLINE_SIZE_ARE_THE_SAME);
+    }
+
+    /**
      * Tests that validation doesn't fail if nothing is broken.
      */
     @Test

Reply via email to