timoninmaxim commented on code in PR #12419:
URL: https://github.com/apache/ignite/pull/12419#discussion_r2432660283
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotCheckProcess.java:
##########
@@ -232,7 +232,37 @@ private void reduceCustomHandlersResults(
});
}
- snpChecker.checkCustomHandlersResults(ctx.req.snapshotName(),
reduced);
+ Map<String, List<SnapshotHandlerResult<?>>> clusterResults = new
HashMap<>();
+ Collection<UUID> execNodes = new ArrayList<>(reduced.size());
+
+ // Checking node -> Map by consistend id.
+ for (Map.Entry<ClusterNode, Map<Object, Map<String,
SnapshotHandlerResult<?>>>> nodeRes : reduced.entrySet()) {
+ // Consistent id -> Map by handler name.
+ for (Map.Entry<Object, Map<String, SnapshotHandlerResult<?>>>
res : nodeRes.getValue().entrySet()) {
+ // Depending on the job mapping, we can get several
different results from one node.
+ execNodes.add(nodeRes.getKey().id());
+
+ Map<String, SnapshotHandlerResult<?>> nodeDataMap =
res.getValue();
+
+ assert nodeDataMap != null : "At least the default
snapshot restore handler should have been executed ";
+
+ for (Map.Entry<String, SnapshotHandlerResult<?>> entry :
nodeDataMap.entrySet()) {
+ String hndName = entry.getKey();
+
+ clusterResults.computeIfAbsent(hndName, v -> new
ArrayList<>()).add(entry.getValue());
+ }
+ }
+ }
+
+ try {
+ kctx.cache().context().snapshotMgr().handlers().completeAll(
+ SnapshotHandlerType.RESTORE, ctx.req.snapshotName(),
clusterResults, execNodes, wrns -> {});
+ }
+ catch (Exception e) {
+ log.warning("The snapshot operation will be aborted due to a
handler error [snapshot=" + ctx.req.snapshotName() + "].", e);
Review Comment:
Let's move the warning to underlying catch block (on line 269), and remove
this try-catch wrapper.
--
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]