Skip to content

Shift from a per-tenant to a per-querier in-memory index cache in the blocks storage #2069

Closed
@pracucci

Description

@pracucci

In the blocks storage implementation, we currently instance a new Thanos in-memory index cache for each tenant:
https://github.com/cortexproject/cortex/blob/master/pkg/querier/block_store.go#L355-L358

This causes the in-memory index cache max size to be unpredictable, given each tenant index cache has a max size, but the number of tenants may grow over the time.

We should shift from a per-tenant to a per-querier in-memory index cache. The only downside is that we do loose the strong guarantee that caches are isolated by tenant, because the cache key is based on the block ID and, theoretically, we may have two tenants with a clashing block ID. For this reason, we should:

  1. Investigate how the block ID generation entropy works, to better understand how likely is we get clashing IDs (two blocks with a clashing ID must be generated the same exact nanosecond and have the same random generated value, so we should verify how the entropy is implemented)
  2. If it's unrealistic having clashing IDs, we should go on with a single instance of the in-memory index cache, otherwise we should open an issue in Thanos and investigate the feasibility to add multi-tenancy support to the index cache

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions