NSAmelchev commented on code in PR #12647:
URL: https://github.com/apache/ignite/pull/12647#discussion_r2716420821


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java:
##########
@@ -1187,15 +1196,17 @@ public <M extends Serializable> void 
storeSnapshotMeta(M meta, File smf) {
     /**
      * Execute the {@link SnapshotHandler#complete(String, Collection)} method 
of the snapshot handlers asynchronously.
      *
-     * @param req Request on snapshot creation.
+     * @param snpOp Snapshot creation operation.
      * @param res Results.
      * @return Future that will be completed when the handlers are finished 
executing.
      */
-    private IgniteInternalFuture<Void> 
completeHandlersAsyncIfNeeded(SnapshotOperationRequest req,
+    private IgniteInternalFuture<Void> 
completeHandlersAsyncIfNeeded(SnapshotOperation snpOp,

Review Comment:
   Done



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java:
##########
@@ -1235,60 +1246,62 @@ private IgniteInternalFuture<Void> 
completeHandlersAsyncIfNeeded(SnapshotOperati
     }
 
     /**
-     * @param req Request on snapshot creation.
+     * @param endReq Snapshot creation end request.
      * @return Future which will be completed when the snapshot will be 
finalized.
      */
-    private IgniteInternalFuture<SnapshotOperationResponse> 
initLocalSnapshotEndStage(SnapshotOperationRequest req) {
-        SnapshotOperationRequest snpReq = clusterSnpReq;
+    private IgniteInternalFuture<SnapshotOperationResponse> 
initLocalSnapshotEndStage(SnapshotOperationEndRequest endReq) {
+        SnapshotOperation snpOp = curSnpOp;
 
-        if (snpReq == null || !Objects.equals(req.requestId(), 
snpReq.requestId()))
+        if (snpOp == null || !Objects.equals(endReq.requestId(), 
snpOp.request().requestId()))
             return new GridFinishedFuture<>();
 
-        IgniteInternalFuture<?> prepFut = req.incremental() ? wrapMsgsFut : 
new GridFinishedFuture<>();
+        SnapshotOperationRequest snpStartReq = curSnpOp.request();
+
+        IgniteInternalFuture<?> prepFut = snpStartReq.incremental() ? 
wrapMsgsFut : new GridFinishedFuture<>();
 
         if (cctx.kernalContext().clientNode())
             return (IgniteInternalFuture<SnapshotOperationResponse>)prepFut;
 
         return prepFut.chain(() -> {
             try {
-                if (req.error() != null) {
-                    snpReq.error(req.error());
+                if (endReq.error() != null) {
+                    snpOp.error(endReq.error());
 
-                    if (req.incremental())
-                        
U.delete(snpReq.snapshotFileTree().incrementalSnapshotFileTree(req.incrementIndex()).root());
+                    if (snpStartReq.incremental())
+                        
U.delete(snpOp.snapshotFileTree().incrementalSnapshotFileTree(snpStartReq.incrementIndex()).root());
                     else
-                        deleteSnapshot(snpReq.snapshotFileTree());
+                        deleteSnapshot(snpOp.snapshotFileTree());
                 }
-                else if (!F.isEmpty(req.warnings())) {
+                else if (!F.isEmpty(endReq.warnings())) {
                     // Pass the warnings further to the next stage for the 
case when snapshot started from not coordinator.
                     if (!isLocalNodeCoordinator(cctx.discovery()))
-                        snpReq.warnings(req.warnings());
+                        snpOp.warnings(endReq.warnings());
 
-                    
snpReq.meta().warnings(Collections.unmodifiableList(req.warnings()));
+                    
snpOp.meta().warnings(Collections.unmodifiableList(endReq.warnings()));
 
-                    storeWarnings(snpReq);
+                    storeWarnings(snpOp);
                 }
 
-                if (req.dump()) {
-                    if (!U.delete(snpReq.snapshotFileTree().dumpLock()))
-                        throw new IgniteCheckedException("Lock file can't be 
deleted: " + snpReq.snapshotFileTree().dumpLock());
+                if (snpStartReq.dump()) {
+                    if (!U.delete(snpOp.snapshotFileTree().dumpLock()))
+                        throw new IgniteCheckedException("Lock file can't be 
deleted: " + snpOp.snapshotFileTree().dumpLock());
                 }
                 else {
                     removeLastMetaStorageKey();
 
-                    if (req.error() == null) {
-                        Collection<Integer> grpIds = 
req.groups().stream().map(CU::cacheId).collect(Collectors.toList());
+                    if (endReq.error() == null) {
+                        Collection<Integer> grpIds = 
snpStartReq.groups().stream().map(CU::cacheId).collect(Collectors.toList());
 
                         enableIncrementalSnapshotsCreation(grpIds);
                     }
                 }
 
                 if (log.isInfoEnabled())
-                    log.info("Finishing local snapshot operation [req=" + req 
+ ']');
+                    log.info("Finishing local snapshot operation [req=" + 
snpOp + ']');
             }
             catch (Exception e) {
                 log.error("Finishing local snapshot operation failed " +
-                    "[req=" + req + ", err=" + e + ']');
+                    "[req=" + snpOp + ", err=" + e + ']');

Review Comment:
   Done



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