mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Merge pull request #1798 from prometheus/beorn7/storage2
Crash recovery: Fix an edge case.
This commit is contained in:
commit
0622304244
|
@ -362,6 +362,10 @@ func (p *persistence) sanitizeSeries(
|
||||||
)
|
)
|
||||||
numMemChunkDescs.Sub(float64(keepIdx))
|
numMemChunkDescs.Sub(float64(keepIdx))
|
||||||
atomic.AddInt64(&numMemChunks, int64(-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:]...)
|
s.chunkDescs = append(cds, s.chunkDescs[keepIdx:]...)
|
||||||
return fp, true
|
return fp, true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue