Skip to content

Commit

Permalink
Ingester: rebuild labels symbol-table on each compaction
Browse files Browse the repository at this point in the history
  • Loading branch information
bboreham committed Apr 8, 2024
1 parent f1cc93e commit f234c67
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/ingester/user_tsdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,5 +630,13 @@ func (u *userTSDB) computeOwnedSeries() int {
}

func (u *userTSDB) resetSymbolTable() {
u.symbolTable.Store(labels.NewSymbolTable())
var st *labels.SymbolTable
if u.db != nil && u.db.Head() != nil {
// Compact all labels in head into one SymbolTable.
st = u.Head().RebuildSymbolTable()
} else {
st = labels.NewSymbolTable()
}
// Then use that for new series going forward.
u.symbolTable.Store(st)
}

0 comments on commit f234c67

Please sign in to comment.