Open jwangace opened 5 days ago
Hello reviewers! :wave: Please follow this checklist when reviewing this Pull Request.
release notes (needs details)
label if users need to know about this change.-
), and have a clear help text.Jobs
should be named in order to mark it as required
.required
, the maintainer team must be notified._vt
tables and RPCs need to be backward compatible.vtctl
command output order should be stable and awk
-able.Website docs would also need an update https://vitess.io/docs/22.0/user-guides/configuration-advanced/query-consolidation/
This would also require addition to summary notes for v22 over https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.0/summary.md
You can see v21 summary notes to see the template to add new configuration to release notes
Updated.
Website docs would also need an update https://vitess.io/docs/22.0/user-guides/configuration-advanced/query-consolidation/
Hi @harshit-gangal This is not in this repo, is it?
Attention: Patch coverage is 87.50000%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 67.38%. Comparing base (
0b51839
) to head (473d6a4
).
Files with missing lines | Patch % | Lines |
---|---|---|
go/sync2/fake_consolidator.go | 0.00% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
Will actually have the desired effect of reducing memory, or will this just cause lots of unconsolidated queries, using even more memory?
Might a better fix be to chunk the responses to the waiting sessions, replying to them in chunks of n instead of all at once?
Will actually have the desired effect of reducing memory, or will this just cause lots of unconsolidated queries, using even more memory?
This is a very good question, let me start with a simple scenario:
The Results, regardless it's just a pointer, meaning no dumplicated content of copies, however there are costs in sending back Results for all the waitted clients, which could be a number when a VTTablet can not handle because of memory limits.
One high memory resulted shoud be the network buffer, now the content of Result will be duplicated copies in each sending-back-socket, with large contents be conjested, it's very hard to control the memory used by tcp/ip buffers, etc.
With this scenario we can quickly realize something isn't correct, assuming VTTablet can handle unlimited waits.
unconsolidated queries will be throttled by connection pools, in this solution.
Might a better fix be to chunk the responses to the waiting sessions, replying to them in chunks of n instead of all at once?
Hoestly, this was another solution in my mind, but it has it's shortcomings, perticularly when the wait is huge, where it might take too many minutes until the last chunk of wait get the result, but usually there are already settings in the middle could cut it already and the application, most likely don't want to wait too many minutes, if the application retries, this could cause exponential backups, which will worse the suituation, for this reason it's better to fail quick OR to throttle queries.
This solution, is simpler. When reaches to max waits, the following queries are fall to get connections, which will quickly use up all connection pools, which essentially let VTTablet to throttle the query, it's a trade off of being slower rather than constantly been OOMKilled.
Description
This fix use config ConsolidatorMaxQueryWait to limit the max number of Wait() for a consolidated query, more same query will still getConn() where is protected by connection pools.
With configureable ConsolidatorMaxQueryWait (default to 0 means unlimit, user can adjust this value accordingly), this will prevent when the Result of first query been returned, same Result would be sent concurrently to large number of clients, cause memory abruptly went high.
Related Issue(s)
https://github.com/vitessio/vitess/issues/17243
Checklist
Deployment Notes