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:
Krasi Georgiev 2020-07-20 18:23:18 +03:00
parent eaa522867e
commit d30492cbb0
1 changed files with 2 additions and 4 deletions

View File

@ -2208,10 +2208,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()
}