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



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CompletedCheckpoint.java
##########
@@ -327,6 +331,9 @@ public static boolean checkpointsMatch(
      */
     void setDiscardCallback(@Nullable CompletedCheckpointStats.DiscardCallback 
discardCallback) {
         this.discardCallback = discardCallback;
+        if (discardCallback != null && isDiscarded) {
+            discardCallback.notifyDiscardedCheckpoint();
+        }

Review comment:
       Can you explain why do we need this change?
   1. Making the field `volatile` sounds like something is fishy with the 
threading model. If I remember correctly those classes are supposed to be non 
thread safe used either in a single thread, or protected by the 
`CheckpointCoordinator`s lock.
   2. triggering the callback in a setter method is also a bit strange




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