-
Notifications
You must be signed in to change notification settings - Fork 2.3k
--consolidator-query-waiter-cap to set the max number of waiter for consolidated query #17244
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
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
eac658f to
b08fc4d
Compare
harshit-gangal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
Website docs would also need an update https://vitess.io/docs/22.0/user-guides/configuration-advanced/query-consolidation/ |
2e429b6 to
86df77e
Compare
Updated. |
Hi @harshit-gangal This is not in this repo, is it? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17244 +/- ##
==========================================
+ Coverage 67.63% 67.65% +0.01%
==========================================
Files 1586 1586
Lines 255566 255576 +10
==========================================
+ Hits 172850 172907 +57
+ Misses 82716 82669 -47 ☔ View full report in Codecov by Sentry. |
48f184e to
7cb8366
Compare
2926cb0 to
e5cdf1a
Compare
76ab56e to
e3bb71b
Compare
Signed-off-by: Jun Wang <[email protected]>
| if waiterCap == 0 || *q.AddWaiterCounter(0) <= waiterCap { | ||
| qre.logStats.QuerySources |= tabletenv.QuerySourceConsolidator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this check is not thread safe, so multiple threads can pass this check and can exceed the waiter cap.
I believe this should be acceptable.
|
Hi @harshit-gangal Thank you so much for your approval! Could I kindly ask for your help to get a second review & approval from someone else? It would be valuable for us if Vitess could accept it, as it helps address the Pod OOM issues we’re facing. |
|
Hi @jwangace, can you merge |
…onsolidated query (vitessio#17244) Signed-off-by: Jun Wang <[email protected]> Co-authored-by: Jun Wang <[email protected]> Signed-off-by: Tim Vaillancourt <[email protected]>
…onsolidated query (vitessio#17244) (#614) Signed-off-by: Jun Wang <[email protected]> Signed-off-by: Tim Vaillancourt <[email protected]> Co-authored-by: jwang <[email protected]> Co-authored-by: Jun Wang <[email protected]>
…onsolidated query (vitessio#17244) (#614) Signed-off-by: Jun Wang <[email protected]> Signed-off-by: Tim Vaillancourt <[email protected]> Co-authored-by: jwang <[email protected]> Co-authored-by: Jun Wang <[email protected]>
…d Journal Events (#585) * VTGate VStream: Ensure reasonable delivery time for reshard journal event (vitessio#16639) Signed-off-by: Malcolm Akinje <[email protected]> Signed-off-by: Malcolm Akinje <[email protected]> * Backport sqlparser patch for v15->v19 upgrade: 14763 Fix accepting bind variables in time related function calls (#590) * Fix accepting bind variables in time related function calls. (vitessio#14763) Signed-off-by: Manan Gupta <[email protected]> * fix test --------- Signed-off-by: Manan Gupta <[email protected]> Co-authored-by: Manan Gupta <[email protected]> * Upgrade vitess addons to 0.19.8 (#591) This upgrade allows us to control whether vtorc raises problems or not via an environment variable. Signed-off-by: Eduardo J. Ortega U. <[email protected]> * Use prefix in all vtorc check and recover logs (vitessio#17526) (#592) This is a backport of vitessio#17526 . Original PR description below: Description This is meant to make recovery actions more easily identified from the logs. See vitessio#17465 Signed-off-by: Eduardo J. Ortega U. <[email protected]> * `slack-19.0`: various backports for `vtorc`, part 2 (#596) * Ensure all topo read calls consider `--topo_read_concurrency` (vitessio#17276) Signed-off-by: Tim Vaillancourt <[email protected]> * Revert "add keyrange support for vtorc clusters_to_watch (#457)" This reverts commit 45c2199. * [release-19.0] `vtorc`: require topo for `Healthy: true` in `/debug/health` (vitessio#17129) (vitessio#17351) Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Manan Gupta <[email protected]> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Tim Vaillancourt <[email protected]> Co-authored-by: Manan Gupta <[email protected]> * `vtorc`: fetch all tablets from cells once + filter during refresh (vitessio#17388) Signed-off-by: Tim Vaillancourt <[email protected]> * Support KeyRange in `--clusters_to_watch` flag (vitessio#17604) Signed-off-by: Manan Gupta <[email protected]> * missing func Signed-off-by: Tim Vaillancourt <[email protected]> * Add api end point to print the current database state in VTOrc (vitessio#15485) Signed-off-by: Manan Gupta <[email protected]> --------- Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Manan Gupta <[email protected]> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Manan Gupta <[email protected]> Co-authored-by: Manan Gupta <[email protected]> * `slack-19.0`: `vtorc`: improve handling of partial cell topo results (#599) * `vtorc`: improve handling of partial cell topo results Signed-off-by: Tim Vaillancourt <[email protected]> * add unit test Signed-off-by: Tim Vaillancourt <[email protected]> * improve test Signed-off-by: Tim Vaillancourt <[email protected]> * add comments Signed-off-by: Tim Vaillancourt <[email protected]> * move sort to test Signed-off-by: Tim Vaillancourt <[email protected]> * goimports Signed-off-by: Tim Vaillancourt <[email protected]> --------- Signed-off-by: Tim Vaillancourt <[email protected]> * `slack-19.0`: skip tests that will fail on v15 downgrade testing (#605) Signed-off-by: Tim Vaillancourt <[email protected]> * `slack-19.0`: Add stats for shards watched by VTOrc (#606) * Add stats for shards watched by VTOrc Signed-off-by: Tim Vaillancourt <[email protected]> * Use len() in make --------- Signed-off-by: Tim Vaillancourt <[email protected]> * Add `GetServerStatus` RPC to use in PRS (vitessio#16022) (#607) Signed-off-by: Manan Gupta <[email protected]> Co-authored-by: Manan Gupta <[email protected]> * backport/patch connection pool bug/perf fixes (#604) * [release-19.0] smartconnpool: do not allow connections to starve (vitessio#17675) (vitessio#17683) Signed-off-by: Dirkjan Bussink <[email protected]> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * smartconnpool: Better handling for idle expiration (vitessio#17756) Signed-off-by: Vicent Marti <[email protected]> --------- Signed-off-by: Dirkjan Bussink <[email protected]> Signed-off-by: Vicent Marti <[email protected]> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Vicent Martí <[email protected]> Co-authored-by: Tim Vaillancourt <[email protected]> * pool: reopen connection closed by idle timeout (vitessio#17818) (#609) Signed-off-by: Harshit Gangal <[email protected]> Signed-off-by: Vicent Martí <[email protected]> Co-authored-by: Harshit Gangal <[email protected]> Co-authored-by: Vicent Martí <[email protected]> * VReplication: Support excluding lagging tablets and use this in vstream manager (vitessio#17835) (#612) * `slack-19.0`: backport v22 VTOrc optimizations, part 2 (#613) * `vtorc`: remove duplicate instance read from backend (vitessio#17834) Signed-off-by: Tim Vaillancourt <[email protected]> * `vtorc`: add index for `inst.ReadInstanceClusterAttributes` table scan Signed-off-by: Tim Vaillancourt <[email protected]> --------- Signed-off-by: Tim Vaillancourt <[email protected]> * Add stats for shards watched by VTOrc, purge stale shards (vitessio#17815) (#616) * --consolidator-query-waiter-cap to set the max number of waiter for consolidated query (vitessio#17244) (#614) Signed-off-by: Jun Wang <[email protected]> Signed-off-by: Tim Vaillancourt <[email protected]> Co-authored-by: jwang <[email protected]> Co-authored-by: Jun Wang <[email protected]> * `slack-19.0` backport v22 `vtorc` optimizations + stats, part 3 (#618) * Remove unused code in discovery queue creation (vitessio#17515) Signed-off-by: Manan Gupta <[email protected]> * vtorc: Cleanup unused code (vitessio#15508) Signed-off-by: Dirkjan Bussink <[email protected]> * `vtorc`: cleanup discover queue, add concurrency flag (vitessio#17825) Signed-off-by: Tim Vaillancourt <[email protected]> * `vtorc`: add tablets watched stats Signed-off-by: Tim Vaillancourt <[email protected]> * fix missing merge conflict update Signed-off-by: Tim Vaillancourt <[email protected]> * `vtorc`: skip unnecessary `inst.ReadTablet` in `logic.LockShard(...)` Signed-off-by: Tim Vaillancourt <[email protected]> * `vtorc`: use `errgroup` in keyspace/shard discovery Signed-off-by: Tim Vaillancourt <[email protected]> * fix import Signed-off-by: Tim Vaillancourt <[email protected]> * fix ineffassign Signed-off-by: Tim Vaillancourt <[email protected]> * missing import Signed-off-by: Tim Vaillancourt <[email protected]> * `vtorc`: add stats for discovery workers Signed-off-by: Tim Vaillancourt <[email protected]> * get count from backend Signed-off-by: Tim Vaillancourt <[email protected]> * rm unused map Signed-off-by: Tim Vaillancourt <[email protected]> --------- Signed-off-by: Manan Gupta <[email protected]> Signed-off-by: Dirkjan Bussink <[email protected]> Signed-off-by: Tim Vaillancourt <[email protected]> Co-authored-by: Manan Gupta <[email protected]> Co-authored-by: Dirkjan Bussink <[email protected]> * Bp pr 17558 pr 17858.slack19.0 (#615) * VReplication: Improve error handling in VTGate VStreams (vitessio#17558) Signed-off-by: Tom Thornton <[email protected]> * Backport vitessio#17858 --------- Signed-off-by: Tom Thornton <[email protected]> * `slack-19.0`: re-backport tweaks from vitessio#17911 (#621) * fix bug in reverse `if` Signed-off-by: Tim Vaillancourt <[email protected]> * simplify Signed-off-by: Tim Vaillancourt <[email protected]> * add `ReadTabletCountsByShard` test Signed-off-by: Tim Vaillancourt <[email protected]> * use map of map Signed-off-by: Tim Vaillancourt <[email protected]> * capitalize Cell Signed-off-by: Tim Vaillancourt <[email protected]> * gofmt lint Signed-off-by: Tim Vaillancourt <[email protected]> * fix plural in names Signed-off-by: Tim Vaillancourt <[email protected]> --------- Signed-off-by: Tim Vaillancourt <[email protected]> * fix releasing the global read lock when mysqlshell backup fails (vitessio#17000) (#623) Signed-off-by: Renan Rangel <[email protected]> * VStream API: allow keyspace-level heartbeats to be streamed (vitessio#16593) (#620) * VStream API: allow keyspace-level heartbeats to be streamed (vitessio#16593) Signed-off-by: Malcolm Akinje <[email protected]> * `slack-19.0` backport v22 `vtorc` optimizations + stats, part 3 (#618) * Remove unused code in discovery queue creation (vitessio#17515) Signed-off-by: Manan Gupta <[email protected]> * vtorc: Cleanup unused code (vitessio#15508) Signed-off-by: Dirkjan Bussink <[email protected]> * `vtorc`: cleanup discover queue, add concurrency flag (vitessio#17825) Signed-off-by: Tim Vaillancourt <[email protected]> * `vtorc`: add tablets watched stats Signed-off-by: Tim Vaillancourt <[email protected]> * fix missing merge conflict update Signed-off-by: Tim Vaillancourt <[email protected]> * `vtorc`: skip unnecessary `inst.ReadTablet` in `logic.LockShard(...)` Signed-off-by: Tim Vaillancourt <[email protected]> * `vtorc`: use `errgroup` in keyspace/shard discovery Signed-off-by: Tim Vaillancourt <[email protected]> * fix import Signed-off-by: Tim Vaillancourt <[email protected]> * fix ineffassign Signed-off-by: Tim Vaillancourt <[email protected]> * missing import Signed-off-by: Tim Vaillancourt <[email protected]> * `vtorc`: add stats for discovery workers Signed-off-by: Tim Vaillancourt <[email protected]> * get count from backend Signed-off-by: Tim Vaillancourt <[email protected]> * rm unused map Signed-off-by: Tim Vaillancourt <[email protected]> --------- Signed-off-by: Manan Gupta <[email protected]> Signed-off-by: Dirkjan Bussink <[email protected]> Signed-off-by: Tim Vaillancourt <[email protected]> Co-authored-by: Manan Gupta <[email protected]> Co-authored-by: Dirkjan Bussink <[email protected]> * Bp pr 17558 pr 17858.slack19.0 (#615) * VReplication: Improve error handling in VTGate VStreams (vitessio#17558) Signed-off-by: Tom Thornton <[email protected]> * Backport vitessio#17858 --------- Signed-off-by: Tom Thornton <[email protected]> * `slack-19.0`: re-backport tweaks from vitessio#17911 (#621) * fix bug in reverse `if` Signed-off-by: Tim Vaillancourt <[email protected]> * simplify Signed-off-by: Tim Vaillancourt <[email protected]> * add `ReadTabletCountsByShard` test Signed-off-by: Tim Vaillancourt <[email protected]> * use map of map Signed-off-by: Tim Vaillancourt <[email protected]> * capitalize Cell Signed-off-by: Tim Vaillancourt <[email protected]> * gofmt lint Signed-off-by: Tim Vaillancourt <[email protected]> * fix plural in names Signed-off-by: Tim Vaillancourt <[email protected]> --------- Signed-off-by: Tim Vaillancourt <[email protected]> --------- Signed-off-by: Malcolm Akinje <[email protected]> Signed-off-by: Manan Gupta <[email protected]> Signed-off-by: Dirkjan Bussink <[email protected]> Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Tom Thornton <[email protected]> Signed-off-by: Malcolm Akinje <[email protected]> Co-authored-by: Tim Vaillancourt <[email protected]> Co-authored-by: Manan Gupta <[email protected]> Co-authored-by: Dirkjan Bussink <[email protected]> Co-authored-by: Tom Thornton <[email protected]> * Increase health check channel buffer (vitessio#17821) (#625) Signed-off-by: Manan Gupta <[email protected]> Signed-off-by: Malcolm Akinje <[email protected]> Co-authored-by: Manan Gupta <[email protected]> * VStream: Allow for automatic resume after Reshard across VStreams (vitessio#15393) (#627) Signed-off-by: Tanjin Xu <[email protected]> Co-authored-by: Matt Lord <[email protected]> --------- Signed-off-by: Malcolm Akinje <[email protected]> Signed-off-by: Malcolm Akinje <[email protected]> Signed-off-by: Manan Gupta <[email protected]> Signed-off-by: Eduardo J. Ortega U. <[email protected]> Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Dirkjan Bussink <[email protected]> Signed-off-by: Vicent Marti <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> Signed-off-by: Vicent Martí <[email protected]> Signed-off-by: Jun Wang <[email protected]> Signed-off-by: Tom Thornton <[email protected]> Signed-off-by: Renan Rangel <[email protected]> Signed-off-by: Tanjin Xu <[email protected]> Co-authored-by: Tanjin Xu <[email protected]> Co-authored-by: Manan Gupta <[email protected]> Co-authored-by: Eduardo J. Ortega U. <[email protected]> Co-authored-by: Tim Vaillancourt <[email protected]> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Manan Gupta <[email protected]> Co-authored-by: Vicent Martí <[email protected]> Co-authored-by: Harshit Gangal <[email protected]> Co-authored-by: Tom Thornton <[email protected]> Co-authored-by: jwang <[email protected]> Co-authored-by: Jun Wang <[email protected]> Co-authored-by: Dirkjan Bussink <[email protected]> Co-authored-by: Renan Rangel <[email protected]> Co-authored-by: Matt Lord <[email protected]>
…onsolidated query (vitessio#17244) Signed-off-by: Jun Wang <[email protected]> Co-authored-by: Jun Wang <[email protected]>
…onsolidated query (vitessio#17244) (#647) Signed-off-by: Jun Wang <[email protected]> Co-authored-by: jwang <[email protected]> Co-authored-by: Jun Wang <[email protected]>
Description
This PR proposed to use config ConsolidatorQueryWaiterCap to set the max number of clients Wait() for all consolidated queries, more same queries will fall back to use getConn() where is protected by connection pools.
With configureable ConsolidatorQueryWaiterCap (default to 0 means unlimit, user can adjust this value accordingly), when properly set would help to 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)
Issue: #17243
Documentation: vitessio/website#1900
Checklist
Deployment Notes