feat(frontend): add max_batch_queries_per_frontend_node
config
#15574
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
We currently have
distributed_query_limit
, but that just limits the number of queries per session.What we want instead is to limit the number of concurrent batch queries cluster wide.
The usecase for it is when there's some batch query which triggers OOM, we want to limit the number of this batch query.
Because meta node doesn't really manage batch queries, we have to do it elsewhere. We choose to do it in
frontend
, because there's typically only 1 frontend node, so effectively, it's a cluster wide limit on the number of batch queries.We simply add the permit to
QueryExecution
which must be dropped (deleted), when the execution ends either due to cancel, errors, or completion.I have tested it locally in the following way:
Execute:
Start 2 long running queries:
Execute another query in local mode:
Can execute without issues.
Execute a query which should be pretty fast:
It will now take a long time.
Cancel the previous 2 queries, and we can continue running queries.
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.