You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "DEADripER (via GitHub)" <gi...@apache.org> on 2026/03/03 03:52:23 UTC
[PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
DEADripER opened a new pull request, #12840:
URL: https://github.com/apache/ignite/pull/12840
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
### The Contribution Checklist
- [ ] There is a single JIRA ticket related to the pull request.
- [ ] The web-link to the pull request is attached to the JIRA ticket.
- [ ] The JIRA ticket has the _Patch Available_ state.
- [ ] The pull request body describes changes that have been made.
The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
- [ ] The pull request title is treated as the final commit message.
The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
- [ ] A reviewer has been mentioned through the JIRA comments
(see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
- [ ] The pull request has been checked by the Teamcity Bot and
the `green visa` attached to the JIRA ticket (see tab `PR Check` at [TC.Bot - Instance 1](https://tcbot2.sbt-ignite-dev.ru/prs.html) or [TC.Bot - Instance 2](https://mtcga.gridgain.com/prs.html))
### Notes
- [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
- [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
- [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
- [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "nizhikov (via GitHub)" <gi...@apache.org>.
nizhikov commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2916063512
##########
modules/core/src/main/java/org/apache/ignite/dump/DumpReader.java:
##########
@@ -365,9 +366,19 @@ private static GridKernalContext standaloneKernalContext(SnapshotFileTree sft, I
private GroupsConfigs groupsConfigs(Dump dump) {
Map<Integer, List<String>> grpsToNodes = new HashMap<>();
List<StoredCacheData> ccfgs = new ArrayList<>();
+ Map<Integer, String> grpIdToName = new HashMap<>();
Set<Integer> grpIds = cfg.groupNames() != null
- ? Arrays.stream(cfg.groupNames()).map(CU::cacheId).collect(Collectors.toSet())
+ ? Arrays.stream(cfg.groupNames())
+ .map(grpName -> {
+ int grpId = CU.cacheId(grpName);
+
+ if (!grpIdToName.containsKey(grpId))
Review Comment:
`if (!grpIdToName.containsKey(grpId))` - redundant check. Let's remove it.
##########
modules/core/src/main/java/org/apache/ignite/dump/DumpReader.java:
##########
@@ -392,11 +403,14 @@ private GroupsConfigs groupsConfigs(Dump dump) {
}
grpsToNodes.get(grp).add(meta.folderName());
+
+ if (!grpIdToName.containsKey(grp))
Review Comment:
`if (!grpIdToName.containsKey(grpId))` - redundant check. Let's remove it.
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2882335470
##########
modules/core/src/main/java/org/apache/ignite/dump/DumpReader.java:
##########
@@ -129,38 +131,40 @@ public DumpReader(DumpReaderConfiguration cfg, IgniteLogger log) {
for (Map.Entry<Integer, List<String>> e : grpsCfgs.grpToNodes.entrySet()) {
int grp = e.getKey();
Review Comment:
Maybe we should rename grp -> grpId - both here and in the log messages?
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2882996299
##########
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);
Review Comment:
The cluster is already active, remove this line.
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2883002240
##########
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);
Review Comment:
Add empty line before.
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2882925062
##########
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));
Review Comment:
```suggestion
IgniteEx ign = startGrid(getConfiguration(id).setConsistentId(id).setGridLogger(testLog));
```
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2883015693
##########
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);
+
+ node1.snapshot().createDump(dumpName1, null).get(getTestTimeout());
+
+ File dumpDir0 = new File(snapshotPath0, dumpName0);
+ File dumpDir1 = new File(snapshotPath1, dumpName1);
+
+ U.copy(dumpDir0, combinedDumpDir, true);
+ U.copy(dumpDir1, combinedDumpDir, true);
+
+ DumpConsumer dummyConsumer = new DumpConsumer() {
+ @Override public void start() {
+ // No-op.
+ }
+
+ @Override public void onMappings(Iterator<TypeMapping> mappings) {
+ // No-op.
+ }
+
+ @Override public void onTypes(Iterator<BinaryType> types) {
+ // No-op.
+ }
+
+ @Override public void onCacheConfigs(Iterator<StoredCacheData> caches) {
+ // No-op.
+ }
+
+ @Override public void onPartition(int grpId, int partId, Iterator<DumpEntry> data) {
+ while (data.hasNext())
+ data.next();
+ }
+
+ @Override public void stop() {
+ // No-op.
+ }
+ };
+
+ new DumpReader(
+ new DumpReaderConfiguration(
+ null,
+ combinedDumpDir.getAbsolutePath(),
+ null,
+ dummyConsumer,
+ DFLT_THREAD_CNT,
+ DFLT_TIMEOUT,
+ false,
+ true,
+ true,
+ new String[]{GRP},
+ null,
+ true,
+ null
+ ),
+ testLog
+ ).run();
+
+ assertTrue(skipLsnr.check());
+ }
+ finally {
+ stopAllGrids();
Review Comment:
Remove this call.
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12840:
URL: https://github.com/apache/ignite/pull/12840#issuecomment-4140869842
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12840) **Quality Gate failed**
Failed conditions
 [2 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12840) (required ≤ 1)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12840)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2882918643
##########
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);
Review Comment:
```suggestion
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);
```
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2889665429
##########
modules/core/src/main/java/org/apache/ignite/dump/DumpReader.java:
##########
@@ -410,11 +426,16 @@ private static class GroupsConfigs {
/** Cache ids. */
public final Set<Integer> cacheIds;
+ /** Mapping from group id to group name. */
+ public final Map<Integer, String> grpIdToName;
+
/** */
- public GroupsConfigs(Map<Integer, List<String>> grpToNodes, Collection<StoredCacheData> cacheCfgs, Set<Integer> cacheIds) {
+ public GroupsConfigs(Map<Integer, List<String>> grpToNodes, Collection<StoredCacheData> cacheCfgs, Set<Integer> cacheIds,
+ Map<Integer, String> grpIdToName) {
Review Comment:
```suggestion
public GroupsConfigs(
Map<Integer, List<String>> grpToNodes,
Collection<StoredCacheData> cacheCfgs,
Set<Integer> cacheIds,
Map<Integer, String> grpIdToName
) {
```
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12840:
URL: https://github.com/apache/ignite/pull/12840#issuecomment-4142818454
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12840) **Quality Gate failed**
Failed conditions
 [2 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12840) (required ≤ 1)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12840)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2889674329
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/IgniteCacheDumpSelf2Test.java:
##########
@@ -1219,6 +1220,185 @@ public void testReadEncrypted() throws Exception {
IntStream.range(0, KEYS_CNT).forEach(i -> assertEquals((Integer)i, dumpEntries.get(i)));
}
+ /** */
+ private void CheckDumpReaderDebugLogsGroupName(String[] grpNames) throws Exception {
Review Comment:
```suggestion
private void checkDumpReaderDebugLogsGroupName(String[] grpNames) throws Exception {
```
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2889749699
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/IgniteCacheDumpSelf2Test.java:
##########
@@ -1219,6 +1220,185 @@ public void testReadEncrypted() throws Exception {
IntStream.range(0, KEYS_CNT).forEach(i -> assertEquals((Integer)i, dumpEntries.get(i)));
}
+ /** */
+ private void CheckDumpReaderDebugLogsGroupName(String[] grpNames) throws Exception {
+ String id = "test";
+
+ setLoggerDebugLevel();
+
+ ListeningTestLogger testLog = new ListeningTestLogger(log);
+
+ LogListener errLsnr = LogListener.matches("Error consuming partition").andMatches("grp=" + GRP).build();
+ LogListener cnsmLsnr = LogListener.matches("Consuming partition").andMatches("grp=" + GRP).build();
+
+ testLog.registerListener(errLsnr);
+ testLog.registerListener(cnsmLsnr);
+
+ 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");
+ }
+ };
+
+ assertThrows(null, () -> new DumpReader(
+ new DumpReaderConfiguration(
+ DMP_NAME,
+ null,
+ ign0.configuration(),
+ cnsmr,
+ DFLT_THREAD_CNT,
+ DFLT_TIMEOUT,
+ true,
+ true,
+ false,
+ grpNames,
+ null,
+ false,
+ null
+ ),
+ testLog
+ ).run(), RuntimeException.class, "trigger error log");
+
+ assertTrue("Log with group name not found", errLsnr.check());
+ assertTrue("Consuming with group name not found", cnsmLsnr.check());
+ }
+
+ /** */
+ @Test
+ public void testDumpReaderDebugLogsGroupName() throws Exception {
+ CheckDumpReaderDebugLogsGroupName(new String[]{GRP});
+ }
+
+ /** */
+ @Test
+ public void testDumpReaderDebugLogsGroupNameNull() throws Exception {
Review Comment:
```suggestion
public void testDumpReaderDebugLogsNullableGroupName() throws Exception {
```
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "nizhikov (via GitHub)" <gi...@apache.org>.
nizhikov merged PR #12840:
URL: https://github.com/apache/ignite/pull/12840
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12840:
URL: https://github.com/apache/ignite/pull/12840#issuecomment-4029587328
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12840) **Quality Gate failed**
Failed conditions
 [3 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12840) (required ≤ 1)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12840)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "nizhikov (via GitHub)" <gi...@apache.org>.
nizhikov commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2882430692
##########
modules/core/src/main/java/org/apache/ignite/dump/DumpReader.java:
##########
@@ -129,38 +131,40 @@ public DumpReader(DumpReaderConfiguration cfg, IgniteLogger log) {
for (Map.Entry<Integer, List<String>> e : grpsCfgs.grpToNodes.entrySet()) {
int grp = e.getKey();
Review Comment:
grp must be used for group name in logs.
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2889713552
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/IgniteCacheDumpSelf2Test.java:
##########
@@ -1219,6 +1220,185 @@ public void testReadEncrypted() throws Exception {
IntStream.range(0, KEYS_CNT).forEach(i -> assertEquals((Integer)i, dumpEntries.get(i)));
}
+ /** */
+ private void CheckDumpReaderDebugLogsGroupName(String[] grpNames) throws Exception {
+ String id = "test";
+
+ setLoggerDebugLevel();
+
+ ListeningTestLogger testLog = new ListeningTestLogger(log);
+
+ LogListener errLsnr = LogListener.matches("Error consuming partition").andMatches("grp=" + GRP).build();
+ LogListener cnsmLsnr = LogListener.matches("Consuming partition").andMatches("grp=" + GRP).build();
+
+ testLog.registerListener(errLsnr);
+ testLog.registerListener(cnsmLsnr);
+
+ 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");
+ }
+ };
+
+ assertThrows(null, () -> new DumpReader(
+ new DumpReaderConfiguration(
Review Comment:
The indentation should be 4 characters.
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2882573082
##########
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();
Review Comment:
`stopAllGrids()` is already called after the test completes in `IgniteCacheDumpSelf2Test#afterTest`, so it can be removed here.
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2883020066
##########
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);
+
+ node1.snapshot().createDump(dumpName1, null).get(getTestTimeout());
+
+ File dumpDir0 = new File(snapshotPath0, dumpName0);
+ File dumpDir1 = new File(snapshotPath1, dumpName1);
+
+ U.copy(dumpDir0, combinedDumpDir, true);
+ U.copy(dumpDir1, combinedDumpDir, true);
+
+ DumpConsumer dummyConsumer = new DumpConsumer() {
+ @Override public void start() {
+ // No-op.
+ }
+
+ @Override public void onMappings(Iterator<TypeMapping> mappings) {
+ // No-op.
+ }
+
+ @Override public void onTypes(Iterator<BinaryType> types) {
+ // No-op.
+ }
+
+ @Override public void onCacheConfigs(Iterator<StoredCacheData> caches) {
+ // No-op.
+ }
+
+ @Override public void onPartition(int grpId, int partId, Iterator<DumpEntry> data) {
+ while (data.hasNext())
Review Comment:
The test passes locally without this code.
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2882808358
##########
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 {
Review Comment:
I suggest replacing it with:
```
assertThrows(null, () -> 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(), RuntimeException.class, "trigger error log");
```
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2882762991
##########
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");
Review Comment:
Add empty line above.
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "nizhikov (via GitHub)" <gi...@apache.org>.
nizhikov commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2924072547
##########
modules/core/src/main/java/org/apache/ignite/dump/DumpReader.java:
##########
@@ -365,9 +366,19 @@ private static GridKernalContext standaloneKernalContext(SnapshotFileTree sft, I
private GroupsConfigs groupsConfigs(Dump dump) {
Map<Integer, List<String>> grpsToNodes = new HashMap<>();
List<StoredCacheData> ccfgs = new ArrayList<>();
+ Map<Integer, String> grpIdToName = new HashMap<>();
Set<Integer> grpIds = cfg.groupNames() != null
- ? Arrays.stream(cfg.groupNames()).map(CU::cacheId).collect(Collectors.toSet())
+ ? Arrays.stream(cfg.groupNames())
+ .map(grpName -> {
+ int grpId = CU.cacheId(grpName);
+
+ if (!grpIdToName.containsKey(grpId))
+ grpIdToName.put(grpId, grpName);
Review Comment:
We can only handle and log groups that dump contains.
No need to store data from arguments.
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12840:
URL: https://github.com/apache/ignite/pull/12840#issuecomment-4142903205
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12840) **Quality Gate failed**
Failed conditions
 [2 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12840) (required ≤ 1)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12840)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2882762991
##########
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");
Review Comment:
Add empty line above.
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2883015693
##########
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);
+
+ node1.snapshot().createDump(dumpName1, null).get(getTestTimeout());
+
+ File dumpDir0 = new File(snapshotPath0, dumpName0);
+ File dumpDir1 = new File(snapshotPath1, dumpName1);
+
+ U.copy(dumpDir0, combinedDumpDir, true);
+ U.copy(dumpDir1, combinedDumpDir, true);
+
+ DumpConsumer dummyConsumer = new DumpConsumer() {
+ @Override public void start() {
+ // No-op.
+ }
+
+ @Override public void onMappings(Iterator<TypeMapping> mappings) {
+ // No-op.
+ }
+
+ @Override public void onTypes(Iterator<BinaryType> types) {
+ // No-op.
+ }
+
+ @Override public void onCacheConfigs(Iterator<StoredCacheData> caches) {
+ // No-op.
+ }
+
+ @Override public void onPartition(int grpId, int partId, Iterator<DumpEntry> data) {
+ while (data.hasNext())
+ data.next();
+ }
+
+ @Override public void stop() {
+ // No-op.
+ }
+ };
+
+ new DumpReader(
+ new DumpReaderConfiguration(
+ null,
+ combinedDumpDir.getAbsolutePath(),
+ null,
+ dummyConsumer,
+ DFLT_THREAD_CNT,
+ DFLT_TIMEOUT,
+ false,
+ true,
+ true,
+ new String[]{GRP},
+ null,
+ true,
+ null
+ ),
+ testLog
+ ).run();
+
+ assertTrue(skipLsnr.check());
+ }
+ finally {
+ stopAllGrids();
Review Comment:
https://github.com/apache/ignite/pull/12840/changes#r2882573082
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2882420230
##########
modules/core/src/main/java/org/apache/ignite/dump/DumpReader.java:
##########
@@ -392,11 +406,14 @@ private GroupsConfigs groupsConfigs(Dump dump) {
}
grpsToNodes.get(grp).add(meta.folderName());
+
+ if (!grpIdToName.containsKey(grp) && !grpCaches.isEmpty())
Review Comment:
`!grpCaches.isEmpty()` - this is always true here.
There's a check above in the loop:
```
if (F.isEmpty(grpCaches))
continue;
```
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2882925062
##########
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));
Review Comment:
```suggestion
IgniteEx ign = startGrid(getConfiguration(id).setConsistentId(id).setGridLogger(testLog));
```
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "nizhikov (via GitHub)" <gi...@apache.org>.
nizhikov commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2916069580
##########
modules/core/src/main/java/org/apache/ignite/dump/DumpReader.java:
##########
@@ -365,9 +366,19 @@ private static GridKernalContext standaloneKernalContext(SnapshotFileTree sft, I
private GroupsConfigs groupsConfigs(Dump dump) {
Map<Integer, List<String>> grpsToNodes = new HashMap<>();
List<StoredCacheData> ccfgs = new ArrayList<>();
+ Map<Integer, String> grpIdToName = new HashMap<>();
Set<Integer> grpIds = cfg.groupNames() != null
- ? Arrays.stream(cfg.groupNames()).map(CU::cacheId).collect(Collectors.toSet())
+ ? Arrays.stream(cfg.groupNames())
+ .map(grpName -> {
+ int grpId = CU.cacheId(grpName);
+
+ if (!grpIdToName.containsKey(grpId))
+ grpIdToName.put(grpId, grpName);
Review Comment:
Why do we want to fullfill `grpIdToName` here?
--
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
Re: [PR] IGNITE-27716: Add group name to DumpReader logs [ignite]
Posted by "DEADripER (via GitHub)" <gi...@apache.org>.
DEADripER commented on code in PR #12840:
URL: https://github.com/apache/ignite/pull/12840#discussion_r2918149110
##########
modules/core/src/main/java/org/apache/ignite/dump/DumpReader.java:
##########
@@ -365,9 +366,19 @@ private static GridKernalContext standaloneKernalContext(SnapshotFileTree sft, I
private GroupsConfigs groupsConfigs(Dump dump) {
Map<Integer, List<String>> grpsToNodes = new HashMap<>();
List<StoredCacheData> ccfgs = new ArrayList<>();
+ Map<Integer, String> grpIdToName = new HashMap<>();
Set<Integer> grpIds = cfg.groupNames() != null
- ? Arrays.stream(cfg.groupNames()).map(CU::cacheId).collect(Collectors.toSet())
+ ? Arrays.stream(cfg.groupNames())
+ .map(grpName -> {
+ int grpId = CU.cacheId(grpName);
+
+ if (!grpIdToName.containsKey(grpId))
+ grpIdToName.put(grpId, grpName);
Review Comment:
We try to create mapping from id to names as full as possible. and if we create DumpReader with some not null grpNames it is better to add them to mapping. I dont think users will add too many values to DumpReader config so i think it is not problem to map them all at the beginning. If i'm wrong u can correct me.
--
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