Skip to content

IGNITE-27716: Add group name to DumpReader logs#12840

Open
DEADripER wants to merge 3 commits intoapache:masterfrom
DEADripER:IGNITE-27716
Open

IGNITE-27716: Add group name to DumpReader logs#12840
DEADripER wants to merge 3 commits intoapache:masterfrom
DEADripER:IGNITE-27716

Conversation

@DEADripER
Copy link
Contributor

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)
  • 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 or TC.Bot - Instance 2)

Notes

If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.

@@ -129,38 +131,40 @@ public DumpReader(DumpReaderConfiguration cfg, IgniteLogger log) {

for (Map.Entry<Integer, List<String>> e : grpsCfgs.grpToNodes.entrySet()) {
int grp = e.getKey();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should rename grp -> grpId - both here and in the log messages?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grp must be used for group name in logs.


grpsToNodes.get(grp).add(meta.folderName());

if (!grpIdToName.containsKey(grp) && !grpCaches.isEmpty())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!grpCaches.isEmpty() - this is always true here.

There's a check above in the loop:

                if (F.isEmpty(grpCaches))
                    continue;

assertTrue("Consuming with group name not found", cnsmLsnr.check());
}
finally {
stopAllGrids();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stopAllGrids() is already called after the test completes in IgniteCacheDumpSelf2Test#afterTest, so it can be removed here.

}
};

try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");

Comment on lines +1226 to +1237
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);
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);

Comment on lines +1240 to +1242
IgniteEx ign0 = startGrid(getConfiguration(id)
.setConsistentId(id)
.setGridLogger(testLog));
Copy link
Contributor

@wernerdv wernerdv Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
IgniteEx ign0 = startGrid(getConfiguration(id)
.setConsistentId(id)
.setGridLogger(testLog));
IgniteEx ign = startGrid(getConfiguration(id).setConsistentId(id).setGridLogger(testLog));

.setGridLogger(testLog));

node0.cluster().state(ClusterState.ACTIVE);
node1.cluster().state(ClusterState.ACTIVE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cluster is already active, remove this line.

.times(parts)
.andMatches("grpName=" + GRP)
.build();
testLog.registerListener(skipLsnr);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add empty line before.


node0.snapshot().createDump(dumpName0, null).get(getTestTimeout());

Thread.sleep(100);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Thread.sleep(100);
U.sleep(100);

assertTrue(skipLsnr.check());
}
finally {
stopAllGrids();
Copy link
Contributor

@wernerdv wernerdv Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this call.

}

@Override public void onPartition(int grpId, int partId, Iterator<DumpEntry> data) {
while (data.hasNext())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test passes locally without this code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants