You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by mm...@apache.org on 2021/11/01 15:21:04 UTC

[ignite] branch ignite-2.12 updated: IGNITE-15849 Remove idle verify and snapshot check ambiguity error output (#9543)

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

mmuzaf pushed a commit to branch ignite-2.12
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/ignite-2.12 by this push:
     new ddf16f4  IGNITE-15849 Remove idle verify and snapshot check ambiguity error output (#9543)
ddf16f4 is described below

commit ddf16f4a1a2eaa93769feb091d97e964ba6479f4
Author: Maxim Muzafarov <mm...@apache.org>
AuthorDate: Mon Nov 1 18:10:59 2021 +0300

    IGNITE-15849 Remove idle verify and snapshot check ambiguity error output (#9543)
---
 .../apache/ignite/util/GridCommandHandlerTest.java |  2 +-
 .../cache/verify/IdleVerifyResultV2.java           | 54 ++++++++--------------
 .../snapshot/IgniteClusterSnapshotCheckTest.java   |  4 +-
 3 files changed, 21 insertions(+), 39 deletions(-)

diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
index c981908..cc6f50a 100644
--- a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
+++ b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
@@ -2179,7 +2179,7 @@ public class GridCommandHandlerTest extends GridCommandHandlerClusterPerMethodAb
         String outputStr = testOut.toString();
 
         assertContains(log, outputStr, "The check procedure failed on 1 node.");
-        assertContains(log, outputStr, "The check procedure has finished, no conflicts have been found.");
+        assertContains(log, outputStr, "CRC check of partition failed");
     }
 
     /** */
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/IdleVerifyResultV2.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/IdleVerifyResultV2.java
index 213d08b..b8e2bb5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/IdleVerifyResultV2.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/IdleVerifyResultV2.java
@@ -195,26 +195,7 @@ public class IdleVerifyResultV2 extends VisorDataTransferObject {
      * @param printExceptionMessages {@code true} if exceptions must be included too.
      */
     public void print(Consumer<String> printer, boolean printExceptionMessages) {
-        boolean noMatchingCaches = false;
-
-        boolean succeeded = true;
-
-        for (Exception e : exceptions.values()) {
-            if (e instanceof NoMatchingCachesException) {
-                noMatchingCaches = true;
-                succeeded = false;
-
-                break;
-            }
-        }
-
-        if (succeeded) {
-            if (!F.isEmpty(exceptions)) {
-                int size = exceptions.size();
-
-                printer.accept("The check procedure failed on " + size + " node" + (size == 1 ? "" : "s") + ".\n");
-            }
-
+        if (F.isEmpty(exceptions)) {
             if (!hasConflicts())
                 printer.accept("The check procedure has finished, no conflicts have been found.\n");
             else
@@ -227,28 +208,29 @@ public class IdleVerifyResultV2 extends VisorDataTransferObject {
 
             printSkippedPartitions(printer, moving, "MOVING");
             printSkippedPartitions(printer, lostPartitions(), "LOST");
-        }
-        else {
-            printer.accept("\nThe check procedure failed.\n");
 
-            if (noMatchingCaches)
-                printer.accept("\nThere are no caches matching given filter options.\n");
+            return;
         }
 
-        if (!F.isEmpty(exceptions())) {
-            printer.accept("\nThe check procedure failed on nodes:\n");
+        int size = exceptions.size();
 
-            for (Map.Entry<ClusterNode, Exception> e : exceptions().entrySet()) {
-                ClusterNode n = e.getKey();
+        printer.accept("The check procedure failed on " + size + " node" + (size == 1 ? "" : "s") + ".\n");
 
-                printer.accept("\nNode ID: " + n.id() + " " + n.addresses() + "\nConsistent ID: " + n.consistentId() + "\n");
+        if (!F.isEmpty(F.view(exceptions.values(), e -> e instanceof NoMatchingCachesException)))
+            printer.accept("\nThere are no caches matching given filter options.\n");
 
-                if (printExceptionMessages) {
-                    String msg = e.getValue().getMessage();
+        printer.accept("\nThe check procedure failed on nodes:\n");
 
-                    printer.accept("Exception: " + e.getValue().getClass().getCanonicalName() + "\n");
-                    printer.accept(msg == null ? "" : msg + "\n");
-                }
+        for (Map.Entry<ClusterNode, Exception> e : exceptions().entrySet()) {
+            ClusterNode n = e.getKey();
+
+            printer.accept("\nNode ID: " + n.id() + " " + n.addresses() + "\nConsistent ID: " + n.consistentId() + "\n");
+
+            if (printExceptionMessages) {
+                String msg = e.getValue().getMessage();
+
+                printer.accept("Exception: " + e.getValue().getClass().getCanonicalName() + "\n");
+                printer.accept(msg == null ? "" : msg + "\n");
             }
         }
     }
@@ -283,7 +265,7 @@ public class IdleVerifyResultV2 extends VisorDataTransferObject {
         int cntrConflictsSize = counterConflicts().size();
         int hashConflictsSize = hashConflicts().size();
 
-        printer.accept("The check procedure has finished, conflict partitions has been found: " +
+        printer.accept("The check procedure has failed, conflict partitions has been found: " +
             "[counterConflicts=" + cntrConflictsSize + ", hashConflicts=" + hashConflictsSize + "]\n");
 
         if (!F.isEmpty(counterConflicts())) {
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotCheckTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotCheckTest.java
index d1b3fa89..49a3c62 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotCheckTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotCheckTest.java
@@ -288,7 +288,7 @@ public class IgniteClusterSnapshotCheckTest extends AbstractSnapshotSelfTest {
 
         assertTrue(F.isEmpty(res.exceptions()));
         assertContains(log, b.toString(),
-            "The check procedure has finished, conflict partitions has been found: [counterConflicts=1, hashConflicts=0]");
+            "The check procedure has failed, conflict partitions has been found: [counterConflicts=1, hashConflicts=0]");
     }
 
     /** @throws Exception If fails. */
@@ -466,7 +466,7 @@ public class IgniteClusterSnapshotCheckTest extends AbstractSnapshotSelfTest {
 
         assertTrue(F.isEmpty(res.exceptions()));
         assertContains(log, b.toString(),
-            "The check procedure has finished, conflict partitions has been found: [counterConflicts=0, hashConflicts=1]");
+            "The check procedure has failed, conflict partitions has been found: [counterConflicts=0, hashConflicts=1]");
     }
 
     /** @throws Exception If fails. */