Add ability to set minValidTime in TSDB (#8415)

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>

* Review feedback

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
This commit is contained in:
Goutham Veeramachaneni 2021-02-18 06:22:35 +01:00 committed by GitHub
parent 1fac1c783b
commit 404d85f7a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -752,6 +752,11 @@ func (h *Head) Init(minValidTime int64) error {
return nil
}
// SetMinValidTime sets the minimum timestamp the head can ingest.
func (h *Head) SetMinValidTime(minValidTime int64) {
h.minValidTime.Store(minValidTime)
}
func (h *Head) loadMmappedChunks() (map[uint64][]*mmappedChunk, error) {
mmappedChunks := map[uint64][]*mmappedChunk{}
if err := h.chunkDiskMapper.IterateAllChunks(func(seriesRef, chunkRef uint64, mint, maxt int64, numSamples uint16) error {