mirror of https://github.com/prometheus/prometheus
Advance buffered iterator correctly on seek
parent
e561c91d53
commit
c1acd3fe85
|
@ -541,9 +541,14 @@ func (b *BufferedSeriesIterator) Seek(t int64) bool {
|
||||||
|
|
||||||
t0 := t - b.buf.delta
|
t0 := t - b.buf.delta
|
||||||
// If the delta would cause us to seek backwards, preserve the buffer
|
// 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 {
|
if t0 <= tcur {
|
||||||
return b.Next()
|
for b.Next() {
|
||||||
|
if tcur, _ = b.it.Values(); tcur >= t {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
b.buf.reset()
|
b.buf.reset()
|
||||||
|
|
Loading…
Reference in New Issue