pnowojski commented on a change in pull request #16582:
URL: https://github.com/apache/flink/pull/16582#discussion_r680674905



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
##########
@@ -1399,6 +1399,33 @@ public void notifyCheckpointAborted(final long 
checkpointID) {
         }
     }
 
+    public void notifyCheckpointSubsumed(long checkpointId) {
+        AbstractInvokable invokable = this.invokable;
+
+        if (executionState == ExecutionState.RUNNING && invokable != null) {
+
+            try {
+                invokable.notifyCheckpointSubsumedAsync(checkpointId);
+            } catch (RejectedExecutionException ex) {
+                // This may happen if the mailbox is closed. It means that the 
task is shutting
+                // down, so we just ignore it.
+                LOG.debug(
+                        "Notify checkpoint subsume {} for {} ({}) was rejected 
by the mailbox",
+                        checkpointId,
+                        taskNameWithSubtask,
+                        executionId);
+            } catch (Exception e) {
+                if (getExecutionState() == ExecutionState.RUNNING) {
+                    LOG.warn("Error while subsuming checkpoint {}.", 
checkpointId, e);
+                }
+            }
+        } else {
+            LOG.info(
+                    "Ignoring checkpoint subsume notification for non-running 
task {}.",
+                    taskNameWithSubtask);
+        }
+    }

Review comment:
       You have resolved my previous comment about code duplication, but it 
still looks very similar as `notifyCheckpointAborted()` and 
`notifyCheckpointCompleted()`?

##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamOperatorWrapper.java
##########
@@ -100,6 +102,16 @@ public void notifyCheckpointComplete(long checkpointId) 
throws Exception {
         }
     }
 
+    public void notifyCheckpointSubsumed(long checkpointId) throws Exception {
+        if (!closed) {
+            if (wrapped instanceof AbstractStreamOperator) {
+                ((AbstractStreamOperator<?>) 
wrapped).notifyCheckpointSubsumed(checkpointId);
+            } else if (wrapped instanceof AbstractStreamOperatorV2) {
+                ((AbstractStreamOperatorV2<?>) 
wrapped).notifyCheckpointSubsumed(checkpointId);
+            }

Review comment:
       You are still adding this method to the public API 
(`AbstractStreamOperator/V2`). What were the drawbacks of @rkhachatryan 's 
suggestion of calling `stateBackend.notifyCheckpointSubsumed()` somewhere 
directly from the `StreamTask`/`OperatorChain`/`StreamOperatorWrapper`, 
bypassing operators all-together?
   
   It's less consistent, but we could use `getKeyedStateBackend()` here, right?




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