timoninmaxim commented on code in PR #10612:
URL: https://github.com/apache/ignite/pull/10612#discussion_r1152102618


##########
modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/snapshot/SnapshotRestoreCommandOption.java:
##########
@@ -37,7 +37,10 @@ public enum SnapshotRestoreCommandOption implements 
CommandArg {
 
     /** Synchronous execution flag. */
     SYNC(SnapshotCreateCommandOption.SYNC.argName(), 
SnapshotCreateCommandOption.SYNC.arg(),
-        SnapshotCreateCommandOption.SYNC.description());
+        SnapshotCreateCommandOption.SYNC.description()),
+
+    /** Check snapshot before restore. */
+    CHECK("--check", null, "Check snapshot before restore(slow!).");

Review Comment:
   Let's add note that this check is similar to the `check` command. Smth like 
that:
   
   Check snapshot **data integrity** before restore (slow!). Similar to the 
"check" command.



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotHandlerContext.java:
##########
@@ -41,21 +41,32 @@ public class SnapshotHandlerContext {
     /** Warning flag of concurrent inconsistent-by-nature streamer updates. */
     private final boolean streamerWrn;
 
+    /** If {@code true} check snapshot before restore. */
+    private final boolean check;
+
     /**
      * @param metadata Snapshot metadata.
      * @param grps The names of the cache groups on which the operation is 
performed.
      * {@code False} otherwise. Always {@code false} for snapshot restoration.
      * @param locNode Local node.
      * @param snpDir The full path to the snapshot files.
      * @param streamerWrn {@code True} if concurrent streaming updates 
occurred during snapshot operation.
+     * @param check If {@code true} check snapshot before restore.

Review Comment:
   SnapshotHandlerContext also used when snapshot is created. Then "before 
restore" isn't correct.



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotHandlerContext.java:
##########
@@ -93,4 +104,9 @@ public ClusterNode localNode() {
     public boolean streamerWarning() {
         return streamerWrn;
     }
+
+    /** @return If {@code true} check snapshot before restore. */

Review Comment:
   same



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotPartitionsVerifyHandler.java:
##########
@@ -146,6 +146,12 @@ public 
SnapshotPartitionsVerifyHandler(GridCacheSharedContext<?, ?> cctx) {
                 ", meta=" + meta + ']');
         }
 
+        if (!opCtx.check()) {
+            log.info("Snapshot check skiped [snpName=" + meta.snapshotName() + 
']');

Review Comment:
   Snapshot **data integrity** check **skipped**?



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java:
##########
@@ -1793,6 +1796,7 @@ public 
IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> checkSnapshot(St
      * @param includeCustomHandlers {@code True} to invoke all user-defined 
{@link SnapshotHandlerType#RESTORE}
      *                              handlers, otherwise only system 
consistency check will be performed.
      * @param incIdx Incremental snapshot index.
+     * @param check If {@code true} check snapshot before restore.

Review Comment:
   "before restore" isn't correct, as this param equals to `true` for the 
"check" command also.



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