diff --git a/tsdb/chunks/head_chunks.go b/tsdb/chunks/head_chunks.go index f63b1ab60..c82e38d63 100644 --- a/tsdb/chunks/head_chunks.go +++ b/tsdb/chunks/head_chunks.go @@ -633,6 +633,11 @@ func (cdm *ChunkDiskMapper) IterateAllChunks(f func(seriesRef, chunkRef uint64, } if err := f(seriesRef, chunkRef, mint, maxt, numSamples); err != nil { + if cerr, ok := err.(*CorruptionErr); ok { + cerr.Dir = cdm.dir.Name() + cerr.FileIndex = segID + return cerr + } return err } } diff --git a/tsdb/head.go b/tsdb/head.go index f1916c69e..7d4ccff23 100644 --- a/tsdb/head.go +++ b/tsdb/head.go @@ -736,7 +736,9 @@ func (h *Head) loadMmappedChunks() (map[uint64][]*mmappedChunk, error) { slice := mmappedChunks[seriesRef] if len(slice) > 0 { if slice[len(slice)-1].maxTime >= mint { - return errors.Errorf("out of sequence m-mapped chunk for series ref %d", seriesRef) + return &chunks.CorruptionErr{ + Err: errors.Errorf("out of sequence m-mapped chunk for series ref %d", seriesRef), + } } }