Browse Source

Avoid panic when the headChunk is nil during isolation.

Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
pull/7550/head
Krasi Georgiev 4 years ago
parent
commit
d30492cbb0
  1. 6
      tsdb/head.go

6
tsdb/head.go

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

Loading…
Cancel
Save