Skip to content

Commit

Permalink
[FLINK-18063][checkpointing] Fix the invalid implementation of Altern…
Browse files Browse the repository at this point in the history
…atingCheckpointBarrierHandler#getAlignmentDurationNanos

We should take the value from active handler instead of aligned handler, because aligned handler is only used for savepoint and in
most cases the unaligned alignment duration should always be 0.

This cloese apache#12460.
  • Loading branch information
zhijiangW committed Jun 9, 2020
1 parent 0cbd5e3 commit d99e1f8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public long getLatestCheckpointId() {

@Override
public long getAlignmentDurationNanos() {
return alignedHandler.getAlignmentDurationNanos();
return activeHandler.getAlignmentDurationNanos();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ public void close() throws IOException {

public abstract long getLatestCheckpointId();

public abstract long getAlignmentDurationNanos();
public long getAlignmentDurationNanos() {
return 0;
}

public long getCheckpointStartDelayNanos() {
return latestCheckpointStartDelayNanos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,6 @@ public long getLatestCheckpointId() {
return pendingCheckpoints.isEmpty() ? -1 : pendingCheckpoints.peekLast().checkpointId();
}

public long getAlignmentDurationNanos() {
return 0;
}

public boolean isCheckpointPending() {
return !pendingCheckpoints.isEmpty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,6 @@ public long getLatestCheckpointId() {
return currentConsumedCheckpointId;
}

@Override
public long getAlignmentDurationNanos() {
return 0;
}

@Override
public String toString() {
return String.format("%s: last checkpoint: %d", taskName, currentConsumedCheckpointId);
Expand Down

0 comments on commit d99e1f8

Please sign in to comment.