Copilot commented on code in PR #6897:
URL: https://github.com/apache/ignite-3/pull/6897#discussion_r2491435833
##########
modules/catalog-compaction/src/integrationTest/java/org/apache/ignite/internal/catalog/compaction/ItCatalogCompactionTest.java:
##########
@@ -305,4 +333,109 @@ private static void expectEarliestCatalogVersion(int
expectedVersion) {
}
});
}
+
+ class DebugInfoCollector {
+ private final List<IgniteImpl> nodes;
+ private final Map<UUID, String> nodesById;
+ private final IgniteStringBuilder buffer = new
IgniteStringBuilder("Test debug info").nl();
+ private final List<InternalTransaction> transactions = new
ArrayList<>();
+
+ DebugInfoCollector(List<IgniteImpl> nodes) {
+ this.nodes = nodes;
+ Map<UUID, String> nodesById = new HashMap<>();
+
+ for (IgniteImpl node : nodes) {
+ nodesById.put(node.id(), node.name());
+ }
+
+ this.nodesById = nodesById;
+ }
+
+ void recordCatalogState(String contextMessage) {
+ buffer.nl();
+
+ for (IgniteImpl node : nodes) {
+ buffer.app("Catalog state(").app(contextMessage)
+ .app(") on node ").app(node.name()).nl();
+
+ CatalogManager mgr = node.catalogManager();
+
+ for (int ver = mgr.earliestCatalogVersion(); ver <
mgr.latestCatalogVersion(); ver++) {
Review Comment:
The loop condition uses `<` instead of `<=`, which excludes the latest
catalog version from being recorded in debug output. This should be `ver <=
mgr.latestCatalogVersion()` to include all catalog versions in the debug
information.
```suggestion
for (int ver = mgr.earliestCatalogVersion(); ver <=
mgr.latestCatalogVersion(); ver++) {
```
##########
modules/catalog-compaction/src/integrationTest/java/org/apache/ignite/internal/catalog/compaction/ItCatalogCompactionTest.java:
##########
@@ -305,4 +333,109 @@ private static void expectEarliestCatalogVersion(int
expectedVersion) {
}
});
}
+
+ class DebugInfoCollector {
Review Comment:
The inner class `DebugInfoCollector` should be declared as `static` since it
doesn't need access to instance members of the outer class
`ItCatalogCompactionTest`. This would make the design clearer and prevent
unintended access to outer class state.
```suggestion
static class DebugInfoCollector {
```
--
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]