Compare commits

...

1 Commits

Author SHA1 Message Date
Claude
2ba5d01b44 fix: only advance minDeadline on aggregation flush, not dedup flush
When `ignore_old_samples` is enabled and `dedup_interval` is shorter than
the aggregation `interval`, `minDeadline` was being advanced on every dedup
flush. This caused samples that were still within the current aggregation
interval to be incorrectly dropped as "too old".

Remove `a.minDeadline.Store(cs.maxDeadline)` from `dedupFlush` so that
`minDeadline` is only advanced when the aggregation interval completes
(in `flush`). Also use `flushTime.UnixMilli()` directly as the new
`minDeadline` value, which correctly represents the aggregation interval
boundary regardless of whether dedup is enabled.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-13 13:23:12 +00:00

View File

@@ -908,7 +908,6 @@ func (a *aggregator) dedupFlush(dedupTime time.Time, cs *currentState) {
return
}
a.minDeadline.Store(cs.maxDeadline)
startTime := time.Now()
deleteDeadline := dedupTime.Add(a.stalenessInterval)
@@ -936,8 +935,8 @@ func (a *aggregator) flush(pushFunc PushFunc, flushTime time.Time, cs *currentSt
ao := a.aggrOutputs
ctx := getFlushCtx(a, ao, pushFunc, flushTime.UnixMilli(), isLast)
a.minDeadline.Store(flushTime.UnixMilli())
if a.dedupInterval <= 0 {
a.minDeadline.Store(cs.maxDeadline)
ctx.isGreen = cs.isGreen
}
ao.flushState(ctx)