Skip to content

is there a plan to optimize cache when ooo is supported #5039

Closed

Description

@haplone

Is your feature request related to a problem? Please describe.
When Support out of order samples ingestion is supported, the current cache strategy will have bug, if we search samples in out_of_order_time_window and cache , while ingest samples in out_of_order_time_window.

Describe the solution you'd like
If search time range in out_of_order_time_window, we should reduce the ttl of result cache or just not cache it?
If we reduce the ttl, we need to add ttl in Store api https://github.com/cortexproject/cortex/blob/master/pkg/chunk/cache/cache.go#L21

type Cache interface {
	Store(ctx context.Context, key []string, buf [][]byte)
	Fetch(ctx context.Context, keys []string) (found []string, bufs [][]byte, missing []string)
	Stop()
}

but as we use type tiered []Cache https://github.com/cortexproject/cortex/blob/master/pkg/chunk/cache/tiered.go#L28 , makes the optimize quite complex , will we consider to make a big optimize for cache ?

Activity

  1. stale commented on May 21, 2023

    @stale

    This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

  2. added
    keepalive
    on May 30, 2023
  3. yeya24 commented on Nov 19, 2023

    @yeya24
    Contributor

    Sorry for the late response.
    @haplone For results cache, there is a per tenant config called frontend.max-cache-freshness. It is used to prevent caching very recent results.

    TTL could also work, but as you said it requires some changes to existing cache API. AFAIK, if you use specific caches like memcached, TTL is supported as a parameter.

    Compared to ttl, It is easier to use this config to help with OOO case. But it needs Cortex operators/uers to configure max cache freshness >= OOO time window.

    If you have any other suggestions, feel free to let me know. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    keepalivetype/feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions