Merge pull request #17074 from prymitive/logs

TSDB: Log when GC / block write starts
This commit is contained in:
Bryan Boreham 2025-09-02 12:55:12 +01:00 committed by GitHub
commit aa12c0d4c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 1 deletions

View File

@ -648,6 +648,7 @@ func (db *DB) keepSeriesInWALCheckpointFn(last int) func(id chunks.HeadSeriesRef
}
func (db *DB) truncate(mint int64) error {
db.logger.Info("series GC started")
db.mtx.RLock()
defer db.mtx.RUnlock()

View File

@ -562,6 +562,7 @@ func (c *LeveledCompactor) Write(dest string, b BlockReader, mint, maxt int64, b
start := time.Now()
uid := ulid.MustNew(ulid.Now(), rand.Reader)
c.logger.Info("write block started", "mint", mint, "maxt", maxt, "ulid", uid)
meta := &BlockMeta{
ULID: uid,
@ -596,7 +597,7 @@ func (c *LeveledCompactor) Write(dest string, b BlockReader, mint, maxt int64, b
}
c.logger.Info(
"write block",
"write block completed",
"mint", meta.MinTime,
"maxt", meta.MaxTime,
"ulid", meta.ULID,

View File

@ -1420,6 +1420,7 @@ func (db *DB) compactOOOHead(ctx context.Context) error {
// Each ULID in the result corresponds to a block in a unique time range.
// The db.cmtx mutex should be held before calling this method.
func (db *DB) compactOOO(dest string, oooHead *OOOCompactionHead) (_ []ulid.ULID, err error) {
db.logger.Info("out-of-order compaction started")
start := time.Now()
blockSize := oooHead.ChunkRange()

View File

@ -1415,6 +1415,7 @@ func (h *Head) truncateOOO(lastWBLFile int, newMinOOOMmapRef chunks.ChunkDiskMap
// truncateSeriesAndChunkDiskMapper is a helper function for truncateMemory and truncateOOO.
// It runs GC on the Head and truncates the ChunkDiskMapper accordingly.
func (h *Head) truncateSeriesAndChunkDiskMapper(caller string) error {
h.logger.Info("Head GC started", "caller", caller)
start := time.Now()
headMaxt := h.MaxTime()
actualMint, minOOOTime, minMmapFile := h.gc()