Merge pull request #7550 from krasi-georgiev/panic-head-chunk

no panic the head memseries has chunks in it
This commit is contained in:
Björn Rabenstein 2020-07-20 17:37:27 +02:00 committed by GitHub
commit d6763acd60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2208,10 +2208,8 @@ func (s *memSeries) iterator(id int, isoState *isolationState, chunkDiskMapper *
previousSamples += int(d.numSamples) previousSamples += int(d.numSamples)
} }
} }
// mmappedChunks does not contain the last chunk. Hence check it separately.
if len(s.mmappedChunks) < ix { if s.headChunk != nil {
previousSamples += s.headChunk.chunk.NumSamples()
} else {
totalSamples += s.headChunk.chunk.NumSamples() totalSamples += s.headChunk.chunk.NumSamples()
} }