Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/receive/multitsdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package receive
import (
"context"
"fmt"
"math"
"os"
"path"
"path/filepath"
Expand Down Expand Up @@ -535,6 +536,11 @@ func (t *MultiTSDB) pruneTSDB(ctx context.Context, logger log.Logger, tenantInst

tdb := tenantTSDB.a.db
head := tdb.Head()
if head.MaxTime() == math.MinInt64 {
tenantTSDB.mtx.RUnlock()
level.Info(logger).Log("msg", "Pruning zombie tenant (never received data)", "maxTime", head.MaxTime())
return true, nil
Copy link
Collaborator

@jnyi jnyi Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we close this tdb then since it doesn't receive any data?

}
Comment on lines +539 to +543
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you bump a counter here?

if head.MaxTime() < 0 {
tenantTSDB.mtx.RUnlock()
return false, nil
Expand Down
Loading