-
Notifications
You must be signed in to change notification settings - Fork 512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Range query not looked up from the results cache when start=end and step=86400 #5253
Comments
This seems roughly expected since we don't cache queries with start and end times that aren't step-aligned? logic |
Oh sure, you're right. I totally forgot about the step alignment. |
We have a configuration option to force the caching of non-step aligned requests ( |
Our main reason for disabling step-alignment was compatibility with PromQL. |
My previous comment is about a different config option. It does not change the query, but force the caching of non-step aligned queries too. If a customer sends repetitive non-step aligned queries with the same exact parameters, it would benefit from the cache anyway. |
picking this up - is there prior art on duplicating or migrating an existing config option into the We have deprecation labels, but it appears that would also mark the CLI option as deprecated, which we don't need because the CLI option |
You can take a look at #4287 It introduces per-tenant |
is there any reason we would want to take this opportunity to set a separate TTL for these queries, a la |
It seems like the plan for this feature is not to enable it by default, but only when we notice a repeated query so I don't think a separate TTL is necessary in that case but I don't feel strongly about it |
As of now, all tenant-specific request cache options under limits are decided with multiple tenantIDs as the input: func (s *splitAndCacheMiddleware) getCacheOptions(tenantIDs []string) (ttl, ttlInOOO, oooWindow time.Duration) {
ttl = validation.SmallestPositiveNonZeroDurationPerTenant(tenantIDs, s.limits.ResultsCacheTTL)
ttlInOOO = validation.SmallestPositiveNonZeroDurationPerTenant(tenantIDs, s.limits.ResultsCacheTTLForOutOfOrderTimeWindow)
oooWindow = validation.MaxDurationPerTenant(tenantIDs, s.limits.OutOfOrderTimeWindow)
return
} These are pretty straightforward as they are scalar values, we have decided to take either the min or max for all tenants depending on the parameter. For boolean values such as Option 1: cache only if all tenants being queried have Option 2: cache if any tenant being queried has My initial instinct is that Option 1 makes the most sense from a user perspective. |
Agreed, I think option 1 makes the most sense. FWIW queries that involve multiple tenants are a small fraction of single-tenant queries in Grafana Cloud and multi-tenant queries (tenant federation) are off by default in Mimir. |
I'm observing some recurring range query requests from a customer which I was expected to be looked up from the results cache, but they're not. The queries look the exact same in terms of query parameters and the end time is older than "10m ago", the customer has no OOO ingestion enabled, so I'm bit puzzled why they're picked up from the cache. I'm opening this issue to track the investigation.
Sample of one of such queries:
start=1686088800
(2023-06-06 22:00:00 UTC)end=1686693600
(2023-06-13 22:00:00 UTC)step=86400
query=REDACTED
(but the exact same across all requests)Edit: these query results are not cached because not step aligned.
The text was updated successfully, but these errors were encountered: