cortex icon indicating copy to clipboard operation
cortex copied to clipboard

Worry more about fingerprint clashes

Open bboreham opened this issue 8 years ago • 4 comments

The chunk store fetch code assumes that fingerprints uniquely identify a timeseries; this is fairly likely when they are looking at a single metric, but we still could get clashes.

Perhaps use the sha256 from the index?

bboreham avatar Feb 19 '18 12:02 bboreham

This is the relevant bits: https://github.com/cortexproject/cortex/blob/master/pkg/querier/chunk_store_queryable.go#L51-L68

The idea is that 2 different series could have same fingerprint and then we just say the chunks for both belong to one.

gouthamve avatar Nov 11 '19 16:11 gouthamve

From a quick look through the code, I've the feeling that we also suffer hash collisions in results cache too (see cache.HashKey usage).

pracucci avatar Dec 05 '19 10:12 pracucci

Not fixed by #3192 which addresses a similar problem in the querier.

I was thinking of code like this: https://github.com/cortexproject/cortex/blob/0a33f9d4c8ff23ec00972e33889b388e302a1df8/pkg/chunk/series_store.go#L248

I also found https://github.com/cortexproject/cortex/blob/0a33f9d4c8ff23ec00972e33889b388e302a1df8/pkg/distributor/distributor.go#L717 https://github.com/cortexproject/cortex/blob/0a33f9d4c8ff23ec00972e33889b388e302a1df8/pkg/distributor/query.go#L114-L120

bboreham avatar Sep 21 '20 10:09 bboreham

Whilst the first example can be dropped when we deprecate chunks (#4268), the others still seem to be valid.

bboreham avatar Jun 10 '21 14:06 bboreham