mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-23 12:44:05 -08:00
fix(tsdb): inc mmap corruption counter on mmap out of sequence error (#10406)
What --- When we see out of sequence chunks increase the chunk corruption counter to indicate that one of the chunks was corrupted. Reference: https://github.com/prometheus/prometheus/pull/10406#issuecomment-1142595527 Signed-off-by: Steve Azzopardi <steveazz@outlook.com>
This commit is contained in:
parent
c511d26dd0
commit
04fe2c9522
|
@ -636,6 +636,7 @@ func (h *Head) loadMmappedChunks(refSeries map[chunks.HeadSeriesRef]*memSeries)
|
|||
if !ok {
|
||||
slice := mmappedChunks[seriesRef]
|
||||
if len(slice) > 0 && slice[len(slice)-1].maxTime >= mint {
|
||||
h.metrics.mmapChunkCorruptionTotal.Inc()
|
||||
return errors.Errorf("out of sequence m-mapped chunk for series ref %d, last chunk: [%d, %d], new: [%d, %d]",
|
||||
seriesRef, slice[len(slice)-1].minTime, slice[len(slice)-1].maxTime, mint, maxt)
|
||||
}
|
||||
|
@ -650,6 +651,7 @@ func (h *Head) loadMmappedChunks(refSeries map[chunks.HeadSeriesRef]*memSeries)
|
|||
}
|
||||
|
||||
if len(ms.mmappedChunks) > 0 && ms.mmappedChunks[len(ms.mmappedChunks)-1].maxTime >= mint {
|
||||
h.metrics.mmapChunkCorruptionTotal.Inc()
|
||||
return errors.Errorf("out of sequence m-mapped chunk for series ref %d, last chunk: [%d, %d], new: [%d, %d]",
|
||||
seriesRef, ms.mmappedChunks[len(ms.mmappedChunks)-1].minTime, ms.mmappedChunks[len(ms.mmappedChunks)-1].maxTime,
|
||||
mint, maxt)
|
||||
|
|
Loading…
Reference in a new issue