Merge pull request #1798 from prometheus/beorn7/storage2

Crash recovery: Fix an edge case.
This commit is contained in:
Björn Rabenstein 2016-07-13 16:53:18 +02:00 committed by GitHub
commit 0622304244
1 changed files with 4 additions and 0 deletions

View File

@ -362,6 +362,10 @@ func (p *persistence) sanitizeSeries(
)
numMemChunkDescs.Sub(float64(keepIdx))
atomic.AddInt64(&numMemChunks, int64(-keepIdx))
if keepIdx == len(s.chunkDescs) {
// No chunks from series file left, head chunk is evicted, so declare it closed.
s.headChunkClosed = true
}
s.chunkDescs = append(cds, s.chunkDescs[keepIdx:]...)
return fp, true
}