dmvk commented on a change in pull request #16652:
URL: https://github.com/apache/flink/pull/16652#discussion_r686635822



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/DefaultCompletedCheckpointStore.java
##########
@@ -95,18 +86,14 @@ public DefaultCompletedCheckpointStore(
             int maxNumberOfCheckpointsToRetain,
             StateHandleStore<CompletedCheckpoint, R> stateHandleStore,
             CheckpointStoreUtil completedCheckpointStoreUtil,
+            Collection<CompletedCheckpoint> completedCheckpoints,
             Executor executor) {
-
         checkArgument(maxNumberOfCheckpointsToRetain >= 1, "Must retain at 
least one checkpoint.");
-
         this.maxNumberOfCheckpointsToRetain = maxNumberOfCheckpointsToRetain;
-
         this.checkpointStateHandleStore = checkNotNull(stateHandleStore);
-
         this.completedCheckpoints = new 
ArrayDeque<>(maxNumberOfCheckpointsToRetain + 1);

Review comment:
       This is just an optimization (a lower bound), so we don't allocate 
unnecessarily large array. Maximum number of checkpoints is enforced by 
`CheckpointSubsumeHelper#subsume` any time a new checkpoint is added.
   
   Only scenario I can think of right now, where this could actually grow 
beyond the initial capacity, is when `maxNumberOfCheckpointsToRetain` changes 
between two restores (user manually changes the configuration). There is no 
harm if this happen.




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