mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-18 03:24:05 -08:00
Avoid panic when the headChunk is nil during isolation.
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
This commit is contained in:
parent
c448ada63d
commit
9a75b5f84b
|
@ -2186,10 +2186,8 @@ func (s *memSeries) iterator(id int, isoState *isolationState, chunkDiskMapper *
|
|||
previousSamples += int(d.numSamples)
|
||||
}
|
||||
}
|
||||
// mmappedChunks does not contain the last chunk. Hence check it separately.
|
||||
if len(s.mmappedChunks) < ix {
|
||||
previousSamples += s.headChunk.chunk.NumSamples()
|
||||
} else {
|
||||
|
||||
if s.headChunk != nil {
|
||||
totalSamples += s.headChunk.chunk.NumSamples()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue