mirror of
https://github.com/prometheus/prometheus
synced 2025-02-09 08:28:19 +00:00
Advance buffered iterator correctly on seek
This commit is contained in:
parent
e561c91d53
commit
c1acd3fe85
@ -541,9 +541,14 @@ func (b *BufferedSeriesIterator) Seek(t int64) bool {
|
||||
|
||||
t0 := t - b.buf.delta
|
||||
// If the delta would cause us to seek backwards, preserve the buffer
|
||||
// and just continue regular advancment.
|
||||
// and just continue regular advancment while filling the buffer on the way.
|
||||
if t0 <= tcur {
|
||||
return b.Next()
|
||||
for b.Next() {
|
||||
if tcur, _ = b.it.Values(); tcur >= t {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
b.buf.reset()
|
||||
|
Loading…
Reference in New Issue
Block a user