Github user aljoscha commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1883#discussion_r59687315
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpoint.java
 ---
    @@ -139,13 +144,43 @@ public boolean acknowledgeTask(
                        
                        ExecutionVertex vertex = 
notYetAcknowledgedTasks.remove(attemptID);
                        if (vertex != null) {
    -                           if (state != null) {
    -                                   collectedStates.add(new StateForTask(
    -                                                   state,
    -                                                   stateSize,
    -                                                   vertex.getJobvertexId(),
    +                           if (state != null || kvState != null) {
    +
    +                                   JobVertexID jobVertexID = 
vertex.getJobvertexId();
    +
    +                                   StateForTaskGroup taskGroupState;
    +
    +                                   if 
(taskGroupStates.containsKey(jobVertexID)) {
    +                                           taskGroupState = 
taskGroupStates.get(jobVertexID);
    +                                   } else {
    +                                           taskGroupState = new 
StateForTaskGroup(jobVertexID, vertex.getTotalNumberOfParallelSubtasks());
    +                                           
taskGroupStates.put(jobVertexID, taskGroupState);
    +                                   }
    +
    +                                   long timestamp = 
System.currentTimeMillis() - checkpointTimestamp;
    +
    +                                   if (state != null) {
    +                                           taskGroupState.putState(
                                                        
vertex.getParallelSubtaskIndex(),
    -                                                   
System.currentTimeMillis() - checkpointTimestamp));
    +                                                   new StateForTask(
    +                                                           state,
    +                                                           stateSize,
    +                                                           timestamp
    +                                                   )
    +                                           );
    +                                   }
    +
    +                                   if (kvState != null) {
    +                                           for (Map.Entry<Integer, 
SerializedValue<StateHandle<?>>> entry : kvState.entrySet()) {
    +                                                   
taskGroupState.putKvState(
    +                                                           entry.getKey(),
    +                                                           new 
KvStateForTasks(
    +                                                                   
entry.getValue(),
    +                                                                   0L,
    --- End diff --
    
    Why is this `0L`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to