You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/05/24 09:41:00 UTC

[GitHub] [ignite] Mmuzaf commented on a change in pull request #7827: IGNITE-12978: add cancel snapshot support

Mmuzaf commented on a change in pull request #7827:
URL: https://github.com/apache/ignite/pull/7827#discussion_r429617961



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotFutureTask.java
##########
@@ -627,7 +629,7 @@ private Runnable wrapExceptionIfStarted(IgniteThrowableRunner exec) {
 
     /** {@inheritDoc} */
     @Override public boolean cancel() {
-        acceptException(new IgniteCheckedException("Snapshot operation has been cancelled by external process " +
+        acceptException(new IgniteFutureCancelledCheckedException("Snapshot operation has been cancelled by external process " +

Review comment:
       Fixed.

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java
##########
@@ -540,10 +542,14 @@ private void processLocalSnapshotStartStageResult(UUID id, Map<UUID, SnapshotOpe
             missed.removeAll(res.keySet());
             missed.removeAll(err.keySet());
 
-            snpReq.hasErr = !F.isEmpty(err) || !missed.isEmpty();
+            boolean cancelled = err.values().stream()
+                .anyMatch(e -> e instanceof IgniteFutureCancelledCheckedException);

Review comment:
       Fixed.

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java
##########
@@ -540,10 +542,14 @@ private void processLocalSnapshotStartStageResult(UUID id, Map<UUID, SnapshotOpe
             missed.removeAll(res.keySet());
             missed.removeAll(err.keySet());
 
-            snpReq.hasErr = !F.isEmpty(err) || !missed.isEmpty();
+            boolean cancelled = err.values().stream()
+                .anyMatch(e -> e instanceof IgniteFutureCancelledCheckedException);
 
-            if (snpReq.hasErr) {
-                U.warn(log, "Execution of local snapshot tasks fails or them haven't been executed " +
+            if (cancelled) {
+                snpReq.err = new IgniteFutureCancelledCheckedException("Execution of snapshot tasks " +
+                    "has been cancelled by external process [err=" + err + ", missed=" + missed + ']');
+            } else if (!F.isEmpty(err) || !missed.isEmpty()) {

Review comment:
       Fixed.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org