Skip to content

Commit e42d765

Browse files
committed
Prevent OOM in the chunk store.
- Merge and dedupe set of strings, not sets of parse chunks. - Limit number of chunks fetched in a single query. - Add lots more debug logging to the querier to help track this all down. Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
1 parent ca08ebc commit e42d765

File tree

8 files changed

+174
-307
lines changed

8 files changed

+174
-307
lines changed

pkg/chunk/by_key.go

Lines changed: 0 additions & 128 deletions
This file was deleted.

pkg/chunk/by_key_test.go

Lines changed: 0 additions & 131 deletions
This file was deleted.

pkg/chunk/chunk.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,11 @@ func (c *Chunk) Decode(decodeContext *DecodeContext, input []byte) error {
314314
return c.Data.UnmarshalFromBuf(remainingData[:int(dataLen)])
315315
}
316316

317+
func equalByKey(a, b Chunk) bool {
318+
return a.UserID == b.UserID && a.Fingerprint == b.Fingerprint &&
319+
a.From == b.From && a.Through == b.Through && a.Checksum == b.Checksum
320+
}
321+
317322
func chunksToMatrix(ctx context.Context, chunks []Chunk, from, through model.Time) (model.Matrix, error) {
318323
sp, ctx := ot.StartSpanFromContext(ctx, "chunksToMatrix")
319324
defer sp.Finish()

0 commit comments

Comments
 (0)