mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 21:24:05 -08:00
storage: fix bug #10027 in iterators' Seek method
Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
parent
b042e29569
commit
0ede6ae321
|
@ -360,6 +360,9 @@ func (c *concreteSeriesIterator) Seek(t int64) bool {
|
|||
if c.cur == -1 {
|
||||
c.cur = 0
|
||||
}
|
||||
if c.cur >= len(c.series.samples) {
|
||||
return false
|
||||
}
|
||||
// No-op check.
|
||||
if s := c.series.samples[c.cur]; s.Timestamp >= t {
|
||||
return true
|
||||
|
|
|
@ -99,6 +99,9 @@ func (it *listSeriesIterator) Seek(t int64) bool {
|
|||
if it.idx == -1 {
|
||||
it.idx = 0
|
||||
}
|
||||
if it.idx >= it.samples.Len() {
|
||||
return false
|
||||
}
|
||||
// No-op check.
|
||||
if s := it.samples.Get(it.idx); s.T() >= t {
|
||||
return true
|
||||
|
|
|
@ -159,6 +159,9 @@ func (it *listSeriesIterator) Seek(t int64) bool {
|
|||
if it.idx == -1 {
|
||||
it.idx = 0
|
||||
}
|
||||
if it.idx >= len(it.list) {
|
||||
return false
|
||||
}
|
||||
// No-op check.
|
||||
if s := it.list[it.idx]; s.T() >= t {
|
||||
return true
|
||||
|
|
Loading…
Reference in a new issue