Skip to content

Query Frontend: queries with negative offset should check whether it is cacheable or not #5678

Closed
@yeya24

Description

@yeya24

Describe the bug
We enabled negative offset feature by default in Cortex. However, negative offset might query data in the future timestamp and those latest data response shouldn't be cached. We missed such check in Query Frontend similar to what we have for @ modifier https://github.com/cortexproject/cortex/blob/master/pkg/querier/tripperware/queryrange/results_cache.go#L313.

Expected behavior
If a query has negative offset, I expect we won't cache its results if the promql query time range after applying negative offset is later than max cache freshness time.

We can also start simple by not caching queries with negative offset.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions