wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2883005468


##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/IgniteCacheDumpSelf2Test.java:
##########
@@ -1219,6 +1220,190 @@ public void testReadEncrypted() throws Exception {
         IntStream.range(0, KEYS_CNT).forEach(i -> assertEquals((Integer)i, 
dumpEntries.get(i)));
     }
 
+    /** */
+    @Test
+    public void testDumpReaderDebugLogsGroupName() throws Exception {
+        String id = "test";
+        setLoggerDebugLevel();
+        ListeningTestLogger testLog = new ListeningTestLogger(log);
+
+        LogListener errLsnr = LogListener.matches("Error consuming partition")
+            .andMatches("grpName=" + GRP)
+            .build();
+        LogListener cnsmLsnr = LogListener.matches("Consuming partition")
+            .andMatches("grpName=" + GRP)
+            .build();
+        testLog.registerListener(errLsnr);
+        testLog.registerListener(cnsmLsnr);
+
+        try {
+            IgniteEx ign0 = startGrid(getConfiguration(id)
+                .setConsistentId(id)
+                .setGridLogger(testLog));
+
+            ign0.cluster().state(ClusterState.ACTIVE);
+
+            IgniteCache<Integer, Integer> cache = ign0.createCache(new 
CacheConfiguration<Integer, Integer>()
+                .setName(CACHE_0)
+                .setGroupName(GRP)
+                .setBackups(1)
+                .setAffinity(new RendezvousAffinityFunction().setPartitions(3))
+            );
+
+            IntStream.range(0, KEYS_CNT).forEach(i -> cache.put(i, i));
+
+            ign0.snapshot().createDump(DMP_NAME, null).get(getTestTimeout());
+
+            TestDumpConsumer cnsmr = new TestDumpConsumer() {
+                @Override public void onPartition(int grp, int part, 
Iterator<DumpEntry> data) {
+                    throw new RuntimeException("trigger error log");
+                }
+            };
+
+            try {
+                new DumpReader(
+                    new DumpReaderConfiguration(
+                        DMP_NAME,
+                        null,
+                        ign0.configuration(),
+                        cnsmr,
+                        DFLT_THREAD_CNT,
+                        DFLT_TIMEOUT,
+                        true,
+                        true,
+                        false,
+                        new String[]{GRP},
+                        null,
+                        false,
+                        null
+                    ),
+                    testLog
+                ).run();
+                fail("Expected IgniteException");
+            }
+            catch (IgniteException ignored) {
+                // No-op.
+            }
+
+            assertTrue("Log with group name not found", errLsnr.check());
+            assertTrue("Consuming with group name not found", 
cnsmLsnr.check());
+        }
+        finally {
+            stopAllGrids();
+        }
+    }
+
+    /** */
+    @Test
+    public void testDumpReaderSkipCopiesLogsGroupName() throws Exception {
+        int parts = 4;
+        String dumpName0 = "dump0";
+        String dumpName1 = "dump1";
+
+        File snapshotPath0 = Files.createTempDirectory("snapshots0").toFile();
+        File snapshotPath1 = Files.createTempDirectory("snapshots1").toFile();
+        File combinedDumpDir = 
Files.createTempDirectory("combined_dump").toFile();
+
+        ListeningTestLogger testLog = new ListeningTestLogger(log);
+
+        LogListener skipLsnr = LogListener.matches("Skip copy partition")
+            .times(parts)
+            .andMatches("grpName=" + GRP)
+            .build();
+        testLog.registerListener(skipLsnr);
+
+        try {
+            IgniteEx node0 = startGrid(getConfiguration("node0")
+                .setConsistentId("node0")
+                .setSnapshotPath(snapshotPath0.getAbsolutePath())
+                .setGridLogger(testLog));
+
+            IgniteEx node1 = startGrid(getConfiguration("node1")
+                .setConsistentId("node1")
+                .setSnapshotPath(snapshotPath1.getAbsolutePath())
+                .setGridLogger(testLog));
+
+            node0.cluster().state(ClusterState.ACTIVE);
+            node1.cluster().state(ClusterState.ACTIVE);
+
+            CacheConfiguration<Integer, Integer> ccfg = new 
CacheConfiguration<Integer, Integer>()
+                .setName(DEFAULT_CACHE_NAME)
+                .setGroupName(GRP)
+                .setBackups(1)
+                .setAffinity(new 
RendezvousAffinityFunction().setPartitions(parts));
+
+            IgniteCache<Integer, Integer> cache = node0.createCache(ccfg);
+
+            IntStream.range(0, KEYS_CNT).forEach(i -> cache.put(i, i));
+
+            node0.snapshot().createDump(dumpName0, null).get(getTestTimeout());
+
+            Thread.sleep(100);

Review Comment:
   ```suggestion
               U.sleep(100);
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to