Skip to content

Commit 404d85f

Browse files
authored
Add ability to set minValidTime in TSDB (prometheus#8415)
Signed-off-by: Goutham Veeramachaneni <[email protected]> * Review feedback Signed-off-by: Goutham Veeramachaneni <[email protected]>
1 parent 1fac1c7 commit 404d85f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tsdb/head.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,11 @@ func (h *Head) Init(minValidTime int64) error {
752752
return nil
753753
}
754754

755+
// SetMinValidTime sets the minimum timestamp the head can ingest.
756+
func (h *Head) SetMinValidTime(minValidTime int64) {
757+
h.minValidTime.Store(minValidTime)
758+
}
759+
755760
func (h *Head) loadMmappedChunks() (map[uint64][]*mmappedChunk, error) {
756761
mmappedChunks := map[uint64][]*mmappedChunk{}
757762
if err := h.chunkDiskMapper.IterateAllChunks(func(seriesRef, chunkRef uint64, mint, maxt int64, numSamples uint16) error {

0 commit comments

Comments
 (0)