anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3559688784


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotVerifyResult.java:
##########
@@ -64,7 +64,14 @@ public IncrementalSnapshotVerifyResult() {
         this.txHashRes = txHashRes;
         this.partHashRes = partHashRes;
         this.partiallyCommittedTxs = partiallyCommittedTxs;
-        this.exceptions = exceptions == null ? null : 
F.viewReadOnly(exceptions, ErrorMessage::new);

Review Comment:
   `viewReadOnly` is a lazy view that creates fresh `ErrorMessage` instances on 
every iteration. The flow is two-pass — `MessageMarshaller.marshal` fills each 
element's serialized form, then `writeTo` iterates again — so with a lazy view 
the write pass would see brand-new elements with the marshalled state lost. Now 
switched to eager `F.transform`, which keeps the one-liner while materializing 
the collection (same fix applies in `GridDhtPartitionsFullMessage` and 
`ServiceSingleNodeDeploymentResult`).



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotVerifyResult.java:
##########
@@ -64,7 +64,14 @@ public IncrementalSnapshotVerifyResult() {
         this.txHashRes = txHashRes;
         this.partHashRes = partHashRes;
         this.partiallyCommittedTxs = partiallyCommittedTxs;
-        this.exceptions = exceptions == null ? null : 
F.viewReadOnly(exceptions, ErrorMessage::new);
+
+        if (exceptions != null) {
+            this.exceptions = new ArrayList<>();

Review Comment:
   Fixed — replaced with `F.transform`, which sizes the backing list internally.



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotVerifyResult.java:
##########
@@ -64,7 +64,14 @@ public IncrementalSnapshotVerifyResult() {
         this.txHashRes = txHashRes;
         this.partHashRes = partHashRes;
         this.partiallyCommittedTxs = partiallyCommittedTxs;
-        this.exceptions = exceptions == null ? null : 
F.viewReadOnly(exceptions, ErrorMessage::new);
+
+        if (exceptions != null) {
+            this.exceptions = new ArrayList<>();
+
+            for (Throwable th : exceptions) {
+                this.exceptions.add(new ErrorMessage(th));
+            }

Review Comment:
   Fixed — the loop is gone entirely (`F.transform` one-liner).



-- 
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