You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/11/02 14:34:21 UTC

[GitHub] [ignite] anton-vinogradov commented on a diff in pull request #10359: IGNITE-17995 Idle_verify must print broken partitions list

anton-vinogradov commented on code in PR #10359:
URL: https://github.com/apache/ignite/pull/10359#discussion_r1011822137


##########
modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerClusterByClassTest.java:
##########
@@ -514,13 +520,19 @@ public void testCacheIdleVerifyTwoConflictTypes() throws Exception {
 
         GridCacheContext<Object, Object> cacheCtx = ignite.cachex(DEFAULT_CACHE_NAME).context();
 
-        corruptDataEntry(cacheCtx, 1, true, false);
+        AffinityFunction aff = cacheCtx.config().getAffinity();

Review Comment:
   newline missed



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/IdleVerifyResultV2.java:
##########
@@ -266,31 +272,59 @@ private void printConflicts(Consumer<String> printer) {
         int hashConflictsSize = hashConflicts().size();
 
         printer.accept("The check procedure has failed, conflict partitions has been found: " +
-            "[counterConflicts=" + cntrConflictsSize + ", hashConflicts=" + hashConflictsSize + "]\n");
+            "[counterConflicts=" + cntrConflictsSize + ", hashConflicts=" + hashConflictsSize + "]" + nl());
+
+        Set<PartitionKeyV2> allConflicts = new HashSet<>();
 
         if (!F.isEmpty(counterConflicts())) {
-            printer.accept("Update counter conflicts:\n");
+            allConflicts.addAll(counterConflicts().keySet());
+
+            printer.accept("Update counter conflicts:" + nl());
 
             for (Map.Entry<PartitionKeyV2, List<PartitionHashRecordV2>> entry : counterConflicts().entrySet()) {
-                printer.accept("Conflict partition: " + entry.getKey() + "\n");
+                printer.accept("Conflict partition: " + entry.getKey() + nl());
 
-                printer.accept("Partition instances: " + entry.getValue() + "\n");
+                printer.accept("Partition instances: " + entry.getValue() + nl());
             }
 
-            printer.accept("\n");
+            printer.accept(nl());
         }
 
         if (!F.isEmpty(hashConflicts())) {
-            printer.accept("Hash conflicts:\n");
+            allConflicts.addAll(hashConflicts().keySet());
+
+            printer.accept("Hash conflicts:" + nl());
 
             for (Map.Entry<PartitionKeyV2, List<PartitionHashRecordV2>> entry : hashConflicts().entrySet()) {
-                printer.accept("Conflict partition: " + entry.getKey() + "\n");
+                printer.accept("Conflict partition: " + entry.getKey() + nl());
 
-                printer.accept("Partition instances: " + entry.getValue() + "\n");
+                printer.accept("Partition instances: " + entry.getValue() + nl());
             }
         }
 
-        printer.accept("\n");
+        printer.accept(nl());
+        printer.accept("Total:" + nl());
+
+        Map<String, TreeSet<Integer>> conflictsSummary = allConflicts.stream()
+            .collect(Collectors.groupingBy(
+                PartitionKeyV2::groupName,
+                Collectors.mapping(
+                    PartitionKeyV2::partitionId,
+                    Collectors.toCollection(TreeSet::new))));
+
+        for (String groupName : conflictsSummary.keySet()) {

Review Comment:
   Let's iterate using the Map.Entry



##########
modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerClusterByClassTest.java:
##########
@@ -851,9 +863,11 @@ private void corruptingAndCheckDefaultCache(
 
         GridCacheContext<Object, Object> cacheCtx = ignite.cachex(DEFAULT_CACHE_NAME).context();
 
-        corruptDataEntry(cacheCtx, 0, true, false);
+        AffinityFunction aff = cacheCtx.config().getAffinity();

Review Comment:
   newline missed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org