Skip to content
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

Remove -store.query-chunk-limit #705

Merged
merged 2 commits into from
Jan 7, 2022
Merged

Conversation

andyasp
Copy link
Contributor

@andyasp andyasp commented Jan 6, 2022

What this PR does:

Previously -querier.max-fetched-chunks-per-query was introduced to limit chunks fetched from long term storage and ingesters. This caused -store.query-chunk-limit to be deprecated, since it only limited chunks from long term storage.

Now that some time has passed since this deprecation, it would be nice to have one flag again. For reference, the deprecation was done in Cortex PR 4125 (not sure if I should link directly).

Which issue(s) this PR fixes:

Fixes #12

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

# CLI flag: -querier.max-fetched-chunks-per-query
[max_fetched_chunks_per_query: <int> | default = 0]
[max_fetched_chunks_per_query: <int> | default = 2000000]
Copy link
Contributor Author

@andyasp andyasp Jan 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if changing this default was correct or not. max_fetched_chunks_per_query previously could not have had a default, since if it was set it would override max_chunks_per_query. With that entanglement now gone, I thought it made sense to inherit the default rather than be left unlimited.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think setting this to the 2M is limit is correct for how this this limit behaves today. In blocks_store_queryable we call MaxChunksPerQueryFromStore which would call the limits.MaxChunksPerQueryFromStore code below. Since we have max_fetched_chunks_per_query set to 0 (disabled) by default with the logic in MaxChunksPerQueryFromStore we would get the max_chunks_per_query limit of 2M since max_fetched_chunks_per_query is not greater than 0.

However, I think the original intention was for this limit to be disabled by default. So maybe 0 is what we want here. 2M chunks seems to be a large amount of chunks so I don't really see us hitting that limit often if ever today so I don't think it would effect anything to disable this limit.

I'm also only looking at the blocks path here since the intention is to remove the chunks storage path.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually in looking at the original PR I see Marco say:

(in my opinion having the limit applied to ingesters too is better than having a true global limit, considering ingesters are currently unbounded, but I'm open to feedback).

So maybe the intention here is to make sure that limit is carried through to introduce a limit to the ingesters and storegateway, so then 2M would be correct as the default.

Copy link
Contributor

@replay replay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done, this change looks good to me

Previously -querier.max-fetched-chunks-per-query was introduced to
limit chunks fetched from long term storage and ingesters. This caused
-store.query-chunk-limit to be deprecated, since it only limited chunks
from long term storage.

Now that some time has passed since this deprecation, it would be nice to
have one flag again.
@andyasp andyasp force-pushed the aasp/remove-query-chunk-limit branch from c51f960 to 7eeeaeb Compare January 7, 2022 14:21
Copy link
Member

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@@ -360,7 +360,7 @@ func (c *store) getMetricNameChunks(ctx context.Context, userID string, from, th
filtered := filterChunksByTime(from, through, chunks)
level.Debug(log).Log("Chunks post filtering", len(chunks))

maxChunksPerQuery := c.limits.MaxChunksPerQueryFromStore(userID)
maxChunksPerQuery := c.limits.MaxChunksPerQuery(userID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than fixing this code (and other files in this package), we should remove it. But until then, this is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree, it felt a little fruitless making some of these edits with the removal pending. I did it in this order to help myself understand it in isolation. I've been looking at the query path removal story, so if that goes well hopefully most of the package will be deleted soon.

@pstibrany pstibrany merged commit 2ecf28f into main Jan 7, 2022
@pstibrany pstibrany deleted the aasp/remove-query-chunk-limit branch January 7, 2022 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove deprecated -store.query-chunk-limit
4 participants