Advance buffered iterator correctly on seek

pull/5805/head
Fabian Reinartz 2016-12-14 21:43:08 +01:00
parent e561c91d53
commit c1acd3fe85
1 changed files with 7 additions and 2 deletions

View File

@ -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()