RocMarshal commented on code in PR #2268:
URL: 
https://github.com/apache/incubator-streampark/pull/2268#discussion_r1103630736


##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/CheckpointProcessor.java:
##########
@@ -41,9 +44,16 @@
 @Component
 public class CheckpointProcessor {
 
+  private static final Byte DEFAULT_FLAG_BYTE = Byte.valueOf("0");
+  private static final Integer SAVEPOINT_CACHE_HOUR = 1;
+
   private final Cache<String, Long> checkPointCache =
       Caffeine.newBuilder().expireAfterAccess(1, TimeUnit.DAYS).build();
 
+  /** Cache to store the savepoint path if be stored in the db. */
+  private final Cache<String, Byte> savepointedCache =

Review Comment:
   1.  I moved the store logic for savepoint here in order to uniform data 
caliber, which could supply the savepoint chk-id field.
   The chk-id is meaningful to adapt the store logic of checkpoints.
   2. For your question: We prefer to store all the completed savepoints and 
checkpoints. However, if the savepoint store-logic follow `checkpoint`, here 
would be some bug-case. If the triggered savepoint is completed after a 
completed checkpoint whose chk-id is bigger than the savepoint, the savepoint 
will be discard  based on the current logic.     So, the `savepointedCache` was 
introduced, If the chk-id  of the completed savepoint is smaller than the 
latest stored checkpoint-id, we just store the savepoint whose triggertime 
within `savepointCache` .



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