ifndef-SleePy commented on a change in pull request #9853: 
[FLINK-13904][checkpointing] Avoid competition of checkpoint triggering
URL: https://github.com/apache/flink/pull/9853#discussion_r335788255
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinatorMasterHooksTest.java
 ##########
 @@ -201,7 +201,7 @@ public void testHooksAreCalledOnTrigger() throws Exception 
{
                cc.addMasterHook(statefulHook2);
 
                // trigger a checkpoint
-               assertTrue(cc.triggerCheckpoint(System.currentTimeMillis(), 
false));
+               assertFalse(cc.triggerCheckpoint(System.currentTimeMillis(), 
false).isCompletedExceptionally());
 
 Review comment:
   Ah, sorry that's my fault. I forgot updating the java doc. I changed the 
behavior of `triggerCheckpoint` a bit. The return value, 
`CompletableFuture<CompletedCheckpoint>`, will not complete until this 
checkpoint is finished. It will not complete immediately after 
`triggerCheckpoint`. Unless there is an error occurred. It's similar to 
`triggerSavepoint`.
   I did this because eventually the `triggerCheckpoint` will be non-blocking. 
It will be separated into several stages, pre-checking, initializing the id and 
checkpointStorageLocation, triggering snapshotting master state, and then 
triggering snapshotting task state. We can't judge the triggering is successful 
or not by a boolean return value as before.
   
   So in this case, we can't wait for the future to complete, because it will 
never complete.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to