Skip to content

Commit

Permalink
Log querier bucket index updates (#9912)
Browse files Browse the repository at this point in the history
Adds logging of querier bucket index updates so we can inspect exactly which bucket index version/timestamp a particular querier is working off of.
  • Loading branch information
jhalterman authored Nov 15, 2024
1 parent f505b0d commit 4e0045a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/storage/tsdb/bucketindex/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ func (l *Loader) updateCachedIndex(ctx context.Context, userID string) {
// is when a tenant has rules configured but hasn't started remote writing yet. Rules will be evaluated and
// bucket index loaded by the ruler.
l.indexesMx.Lock()
userIdx := l.indexes[userID]
if idx != nil {
if userIdx == nil || (userIdx.index != nil && userIdx.index.UpdatedAt != idx.UpdatedAt) {
level.Debug(l.logger).Log("msg", "loaded bucket index", "user", userID, "updatedAt", idx.UpdatedAt)
}
}
l.indexes[userID].index = idx
l.indexes[userID].err = err
l.indexes[userID].setUpdatedAt(startTime)
Expand Down

0 comments on commit 4e0045a

Please sign in to comment.