Skip to content

Commit

Permalink
Add logging for quorum count update
Browse files Browse the repository at this point in the history
  • Loading branch information
Xinyu Liu committed Aug 16, 2024
1 parent 58f27d5 commit b050979
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ private final static class WatermarkState {
private final long createTime;
private final LongSupplier systemTimeFunc;
private volatile long watermarkTime = WATERMARK_NOT_EXIST;
private volatile int quorumCount = 0;

WatermarkState(
int expectedTotal,
Expand Down Expand Up @@ -107,6 +108,13 @@ synchronized void update(long timestamp, String taskName) {

// Active tasks must exceed the quorum size
minWatermark = (updateCount >= quorumSize && min != Long.MAX_VALUE) ? min : WATERMARK_NOT_EXIST;

// Log the current quorum count
if (this.quorumCount != updateCount) {
this.quorumCount = updateCount;
LOG.info("Current quorum count is {} for watermark aggregation, and the expected quorum size is {}",
this.quorumCount, this.quorumSize);
}
}
watermarkTime = Math.max(watermarkTime, minWatermark);
}
Expand Down

0 comments on commit b050979

Please sign in to comment.