Change connection pool idle expiration logic#19004
Conversation
Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
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
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #19004 +/- ##
=======================================
Coverage ? 69.82%
=======================================
Files ? 1610
Lines ? 215363
Branches ? 0
=======================================
Hits ? 150378
Misses ? 64985
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mattlord
left a comment
There was a problem hiding this comment.
Makes sense to me. I only had the one question about how we handle the case where fail to return the conn.
Thank you for jumping on this so quickly! ❤️
|
I'll add some tests as well so we have coverage for this behavior. |
|
📝 Documentation updates detected! Updated existing suggestion: Add v24.0.0 changelog entries for VTTablet bug fixes |
Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
mhamza15
left a comment
There was a problem hiding this comment.
If I'm not mistaken, this will cause the new connection stacks to be in reverse order. Is there a concern that new connections will be on the bottom of the stack?
I don't think this matters. The connection stack is not strictly ordered by the I could reverse the order of putting the connections back if we have stronger feelings about it? |
I definitely don't know if it will have a tangible impact, so no strong feelings here. If it's an easy switch, maybe maintaining the order will offer less surprises, but no concerns from me 👍 |
There was a problem hiding this comment.
This change make sense to me 🎉
I would suggest we benchmark this, but I suspect we wouldn't be accurately testing this code path, as the benchmark is likely to create very-active connection pools, unless we added specific tests that would mimic an occasionally-used pool. So I'm not suggesting we benchmark this, but I wish we were in a place where that would give us confidence. The area I'm most curious about is when we iterate over every connection while others are waiting
I also wanted to call out that it would be nice to have an e2e test for this, but that could be a project on it's own. Technically it should be possible to simulate an idle MySQL connection and using tablet-stats we could check the pool acted properly, but this would be a large amount of work. cc'ing @arthurschreiber / @mattlord to validate whether or not this would be possible, and if you agree the effort required is out-of-scope
@arthurschreiber It was explicitly designed to be a LIFO queue, so it's probably worth doing: #14033 |
|
Thanks for all the feedback so far! ❤️ I added a comment that explains why the order we put connections back doesn't really matter, @harshit-gangal made me aware that there's either is non-optimal so it makes no difference. 😅 I pushed another change that limits the amount of connections we expire in a single iteration - which means we never expire all connections in a single iteration which should fix any concerns around expiring all connections and then not being able to serve spikes in traffic. I also added a bunch of comments to explain why this is implemented this way. |
go/pools/smartconnpool/pool.go
Outdated
| // | ||
| // We will expire any additional connections in the next iteration of the idle closer. | ||
| expiredConnections := make([]*Pooled[C], 0, max(pool.Active()/2, 1)) | ||
| validConnections := make([]*Pooled[C], 0) |
There was a problem hiding this comment.
What's the expectation here of the number of valid connections? Should we preallocate something bigger? If we don't want to, we can leave this as nil here better?
There was a problem hiding this comment.
The max number of valid connections could be somewhere around pool.Capacity() - but only in the case where none of the connections have expired, and they all use the same settings.
If the connections use different settings, they will be in different stacks, and if they are actively being used they won't be in any of the stacks at the time this code runs.
I think I'll go and use the value of pool.Active() - it is likely to over-allocate, but given that this list only is storing a bunch of pointers, and is most likely not even going to reach 1k entries in most sensible setups, wasting a few bytes for a few microseconds is not going to be an issue.
Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
mattlord
left a comment
There was a problem hiding this comment.
LGTM. Nice work on this, @arthurschreiber ! ❤️
Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
…#19004) (vitessio#19013) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: Arthur Schreiber <arthur@planetscale.com>
…#19004) (vitessio#19013) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: Arthur Schreiber <arthur@planetscale.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com>
…#19004) (vitessio#19014) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
…#19004) (vitessio#19014) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Signed-off-by: Jun Wang <jun.wang@demonware.net>
…#19004) (vitessio#19014) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Signed-off-by: Jun Wang <jun.wang@demonware.net>
…#19004) (vitessio#19014) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Signed-off-by: Jun Wang <jun.wang@demonware.net>
* [release-22.0] Bump to `v22.0.1-SNAPSHOT` after the `v22.0.0` release (vitessio#18225) Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr> Co-authored-by: Florent Poinsard <florent.poinsard@outlook.fr> * [release-22.0] fix: Preserve multi-column TupleExpr in tuple simplifier (vitessio#18216) (vitessio#18220) Signed-off-by: Harshit Gangal <harshit@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Harshit Gangal <harshit@planetscale.com> * [release-22.0] Properly handle grpc dial errors in the throttler metric aggregation (vitessio#18073) (vitessio#18231) Signed-off-by: Arthur Schreiber <arthurschreiber@github.com> Signed-off-by: Mohamed Hamza <mhamza15@github.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Mohamed Hamza <mhamza15@github.com> * [release-22.0] test: TestQueryTimeoutWithShardTargeting fix flaky test (vitessio#18242) (vitessio#18250) Signed-off-by: Harshit Gangal <harshit@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] make sure to give MEMBER OF the correct precedence (vitessio#18237) (vitessio#18245) Signed-off-by: Andres Taylor <andres@planetscale.com> Co-authored-by: Andrés Taylor <andres@planetscale.com> * [release-22.0] Fix evalengine crashes on unexpected types (vitessio#18254) (vitessio#18258) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Fix subquery merging regression introduced in vitessio#11379 (vitessio#18260) (vitessio#18263) Signed-off-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: Andrés Taylor <andres@planetscale.com> * [release-22.0] json array insert test (vitessio#18284) (vitessio#18286) Signed-off-by: Harshit Gangal <harshit@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Harshit Gangal <harshit@planetscale.com> * [release-22.0] Fix `SET` and `START TRANSACTION` in create procedure statements (vitessio#18279) (vitessio#18293) Signed-off-by: Manan Gupta <manan@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Fix deadlock in semi-sync monitor (vitessio#18276) (vitessio#18290) Signed-off-by: Manan Gupta <manan@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Upgrade the Golang version to `go1.24.3` (vitessio#18239) Signed-off-by: GitHub <noreply@github.com> Signed-off-by: Andres Taylor <andres@planetscale.com> Co-authored-by: frouioui <frouioui@users.noreply.github.com> Co-authored-by: Andres Taylor <andres@planetscale.com> * [release-22.0] Atomic Copy: Handle error that was ignored while streaming tables and log it (vitessio#18313) (vitessio#18316) Signed-off-by: Rohit Nayak <rohit@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] fix: handle dml query for None opcode (vitessio#18326) (vitessio#18345) Signed-off-by: Harshit Gangal <harshit@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Harshit Gangal <harshit@planetscale.com> * [release-22.0] fix: keep LIMIT/OFFSET even when merging UNION queries (vitessio#18361) (vitessio#18363) Signed-off-by: Andres Taylor <andres@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Andres Taylor <andres@planetscale.com> * [release-22.0] Fix: Deadlock in `Close` and `write` in semi-sync monitor. (vitessio#18359) (vitessio#18368) Signed-off-by: Manan Gupta <manan@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Upgrade the Golang version to `go1.24.4` (vitessio#18329) Signed-off-by: GitHub <noreply@github.com> Signed-off-by: Manan Gupta <manan@planetscale.com> Co-authored-by: frouioui <frouioui@users.noreply.github.com> Co-authored-by: Manan Gupta <manan@planetscale.com> * [release-22.0] fix version issue when using --mysql-shell-speedup-restore=true (vitessio#18310) (vitessio#18356) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Split workflow with flaky vdiff2 e2e test. Skip flaky Migrate test. (vitessio#18300) (vitessio#18334) Signed-off-by: Rohit Nayak <rohit@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Throttler: keep watching topo even on error (vitessio#18223) (vitessio#18322) Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Code Freeze for `v22.0.1` (vitessio#18374) Signed-off-by: Manan Gupta <manan@planetscale.com> * [release-22.0] Release of `v22.0.1` (vitessio#18375) Signed-off-by: Manan Gupta <manan@planetscale.com> * [release-22.0] Bump to `v22.0.2-SNAPSHOT` after the `v22.0.1` release (vitessio#18380) Signed-off-by: Manan Gupta <manan@planetscale.com> * [release-22.0] [Bugfix] Broken Heartbeat system in Row Streamer (vitessio#18390) (vitessio#18398) Signed-off-by: siddharth16396 <siddharth16396@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] test: Fix race condition in TestStreamRowsHeartbeat (vitessio#18414) (vitessio#18420) Signed-off-by: siddharth16396 <siddharth16396@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Online DDL: resume vreplication after cut-over/RENAME failure (vitessio#18428) (vitessio#18437) Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Noble Mittal <62551163+beingnoble03@users.noreply.github.com> * [release-22.0] Fix `vttablet` not being marked as not serving when MySQL stalls (vitessio#17883) (vitessio#18454) Signed-off-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Topo: Add NamedLock test for zk2 and consul and get them passing (vitessio#18407) (vitessio#18410) Signed-off-by: Matt Lord <mattalord@gmail.com> Signed-off-by: Harshit Gangal <harshit@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Harshit Gangal <harshit@planetscale.com> * [release-22.0] Reset in-memory sequence info on vttablet on UpdateSequenceTables request (vitessio#18415) (vitessio#18445) Signed-off-by: Noble Mittal <noblemittal@outlook.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Noble Mittal <noblemittal@outlook.com> * [release-22.0] bugfix: Fix impossible query for UNION (vitessio#18463) (vitessio#18465) Signed-off-by: Andres Taylor <andres@planetscale.com> Co-authored-by: Andrés Taylor <andres@planetscale.com> * [release-22.0] VReplication: Fix bug while reading _vt.vreplication record (vitessio#18478) (vitessio#18483) Signed-off-by: Rohit Nayak <rohit@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Fix for simple projection showing no fields (vitessio#18489) (vitessio#18493) Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> Signed-off-by: Harshit Gangal <harshit@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Harshit Gangal <harshit@planetscale.com> * [release-22.0] Fix scalar aggregation with literals in empty result sets (vitessio#18477) (vitessio#18491) Signed-off-by: Andres Taylor <andres@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Fix watcher storm during topo outages (vitessio#18434) (vitessio#18440) Signed-off-by: Harshit Gangal <harshit@planetscale.com> Co-authored-by: Harshit Gangal <harshit@planetscale.com> * [release-22.0] Avoid terminating atomic copy workflows on error if they are out of copy phase (vitessio#18475) (vitessio#18487) Signed-off-by: Noble Mittal <noblemittal@outlook.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Bump @babel/runtime from 7.26.0 to 7.27.6 in /web/vtadmin (vitessio#18467) (vitessio#18502) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [release-22.0] Bump vite from 4.5.9 to 4.5.14 in /web/vtadmin (vitessio#18485) (vitessio#18500) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [release-22.0] Fix regression in v22 around new flag setup (vitessio#18507) (vitessio#18509) Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Bump form-data from 4.0.1 to 4.0.4 in /web/vtadmin (vitessio#18473) (vitessio#18504) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [release-22.0] bugfix: Plan group by only on top of derived tables correctly (vitessio#18505) (vitessio#18511) Signed-off-by: Andres Taylor <andres@planetscale.com> Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Dirkjan Bussink <d.bussink@gmail.com> * [release-22.0] Fix GetSchema RPC to prevent returning view definitions when EnableViews is disabled (vitessio#18513) (vitessio#18517) Signed-off-by: Harshit Gangal <harshit@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] CI: Fix `VDiff2` flaky e2e test (vitessio#18494) (vitessio#18526) Signed-off-by: Noble Mittal <noblemittal@outlook.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Fix foreign key relation with routed tables (vitessio#18537) (vitessio#18541) Signed-off-by: Harshit Gangal <harshit@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Try updating the create PR workflow step (vitessio#18563) (vitessio#18571) Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Fix a panic in VDiff when reconciling extra rows. (vitessio#18585) (vitessio#18596) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] fix: remove database qualifier after building query in operator to sql (vitessio#18602) (vitessio#18605) Signed-off-by: Harshit Gangal <harshit@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Introduce aliases for foreign keys verify operations (vitessio#18601) (vitessio#18614) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> * [release-22.0] [CI] Use the draft state from the event payload instead of calling `curl`. (vitessio#18650) (vitessio#18652) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] fix: Fix `GenerateShardRanges` returning shard names that don't cover the full range (vitessio#18641) (vitessio#18654) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Arthur Schreiber <arthur@planetscale.com> * [release-22.0] Fix: Improve VDiff internal query performance (vitessio#18579) (vitessio#18632) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Arthur Schreiber <arthur@planetscale.com> * [release-22.0] Simplify workflow files. (vitessio#18649) (vitessio#18656) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> * [release-22.0] ci: Replace `always()` with `!cancelled()`. (vitessio#18659) (vitessio#18662) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] ci: Disable man-db auto updates. (vitessio#18665) (vitessio#18668) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] ci: Bump `actions/setup-go` to `v5.5.0`. (vitessio#18660) (vitessio#18670) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Update codeowners and maintainers. (vitessio#18676) * [release-22.0] Upgrade the Golang version to `go1.24.7` (vitessio#18621) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Nick Van Wiggeren <nick@planetscale.com> Co-authored-by: frouioui <35779988+frouioui@users.noreply.github.com> Co-authored-by: Nick Van Wiggeren <nick@planetscale.com> * [release-22.0] ci: don't run codecov twice. (vitessio#18680) (vitessio#18682) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Update CODEOWNERS (vitessio#18697) (vitessio#18699) Signed-off-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] fix: ensure callbacks are not called after `VStream` returns (vitessio#18689) (vitessio#18705) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> * [release-22.0] CONNPOOL: Fix race condition when waiting for connection (vitessio#18713) (vitessio#18721) Signed-off-by: Arthur Schreiber <arthurschreiber@github.com> Signed-off-by: Matt Lord <mattalord@gmail.com> Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Matt Lord <mattalord@gmail.com> Co-authored-by: Arthur Schreiber <arthur@planetscale.com> * [release-22.0] connpool: Bump the hang detection timeout to fix flakiness (vitessio#18722) (vitessio#18724) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Fix handling of tuple bind variables in filtering operations. (vitessio#18736) (vitessio#18746) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Potential fix for code scanning alert no. 2992: Clear-text logging of sensitive information (vitessio#18754) (vitessio#18759) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Matt Lord <mattalord@gmail.com> * [release-22.0] update java packages to use central instead of ossrh (vitessio#18765) (vitessio#18766) Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] VReplication: Ensure proper handling of keyspace/database names with dashes (vitessio#18762) (vitessio#18772) Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Matt Lord <mattalord@gmail.com> * [release-22.0] Resolve `commons-lang` vulnerability in Java driver (vitessio#18768) (vitessio#18796) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] ci: use the newest mysql apt config package (vitessio#18790) (vitessio#18793) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: Arthur Schreiber <arthur@planetscale.com> * [release-22.0] `vtctldclient GetPermissions`: hide `authentication_string` from response (vitessio#18771) (vitessio#18798) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com> * [release-22.0] repltracker: reset replica lag when we are primary (vitessio#18800) (vitessio#18806) Signed-off-by: Nick Van Wiggeren <nick@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Address dir traversal in file backup storage `GetBackups` RPC (vitessio#18814) (vitessio#18817) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] VReplication: Treat ER_BINLOG_CREATE_ROUTINE_NEED_SUPER as unrecoverable (vitessio#18784) (vitessio#18819) Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Upgrade the Golang version to `go1.24.9` (vitessio#18737) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Nick Van Wiggeren <nick@planetscale.com> Co-authored-by: frouioui <35779988+frouioui@users.noreply.github.com> Co-authored-by: Nick Van Wiggeren <nick@planetscale.com> * [release-22.0] vtadmin: upgrade vite to the latest (vitessio#18803) (vitessio#18811) Signed-off-by: Nick Van Wiggeren <nick@planetscale.com> Co-authored-by: Nick Van Wiggeren <nickvanw@users.noreply.github.com> * [release-22.0] Fix bug where query consolidator returns empty result without error when the waiter cap exceeded (vitessio#18782) (vitessio#18832) Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Stas Maksimov <maksimov@gmail.com> Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com> * [release-22.0] ci: extract os tuning (vitessio#18824) (vitessio#18826) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> * [release-22.0] ci: DRY up MySQL Setup (vitessio#18815) (vitessio#18836) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> * [release-22.0] Fix flaky tests (vitessio#18835) (vitessio#18838) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> * [release-22.0] copy_state: use a mediumblob instead of a smaller varbinary for lastpk (vitessio#18852) (vitessio#18858) Signed-off-by: Nick Van Wiggeren <nick@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] BuiltinBackupEngine: Retry file close and fail backup when we cannot (vitessio#18848) (vitessio#18861) Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] fix sqlSelectLimit propagating to subqueries (vitessio#18716) (vitessio#18872) Signed-off-by: ghostframe <marcosandresdiaz@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Code Freeze for `v22.0.2` (vitessio#18876) Signed-off-by: Matt Lord <mattalord@gmail.com> * [release-22.0] Release of `v22.0.2` (vitessio#18878) Signed-off-by: Matt Lord <mattalord@gmail.com> * [release-22.0] Bump to `v22.0.3-SNAPSHOT` after the `v22.0.2` release (vitessio#18881) Signed-off-by: Matt Lord <mattalord@gmail.com> * [release-22.0] Improve Semi-Sync Monitor Behavior to Prevent Errant ERS (vitessio#18884) (vitessio#18906) Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Matt Lord <mattalord@gmail.com> * [release-22.0] Bump js-yaml from 4.1.0 to 4.1.1 in /web/vtadmin (vitessio#18908) (vitessio#18910) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [release-22.0] Upgrade the Golang version to `go1.24.10` (vitessio#18897) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: frouioui <35779988+frouioui@users.noreply.github.com> Co-authored-by: Matt Lord <mattalord@gmail.com> * [release-22.0] `vtbench`: add `--db-credentials-*` flags (vitessio#18913) (vitessio#18921) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Properly Strip Keyspace Table Qualifiers in FK Constraints (vitessio#18926) (vitessio#18934) Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Matt Lord <mattalord@gmail.com> * [release-22.0] Stop using Equinix Metal self hosted runners (vitessio#18942) (vitessio#18943) Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Drop dependency on `npm`, bump version of `glob`. (vitessio#18931) (vitessio#18957) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Don't hardcode the go version to use for upgrade/downgrade tests. (vitessio#18920) (vitessio#18955) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> * [release-22.0] connpool: fix connection leak during idle connection reopen (vitessio#18967) (vitessio#18970) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> * [release-22.0] Potential fix for code scanning alert no. 3944: Database query built … (vitessio#18962) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * [release-22.0] vdiff: do not sort by table name in summary, it is not necessary (vitessio#18972) (vitessio#18977) Signed-off-by: Nick Van Wiggeren <nick@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] VDiff: Handle the case where a workflow's table has been dropped on the source (vitessio#18985) (vitessio#18988) Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] CI: Improve reliability of codecov workflow with larger runner (vitessio#18992) (vitessio#18994) Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Change connection pool idle expiration logic (vitessio#19004) (vitessio#19013) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: Arthur Schreiber <arthur@planetscale.com> * [release-22.0] `ci`: use `etcd` v3.5.25, add retries (vitessio#19015) (vitessio#19021) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com> * [release-22.0] Bump org.apache.logging.log4j:log4j-core from 2.24.1 to 2.25.3 in /java (vitessio#19063) (vitessio#19065) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [release-22.0] Skip flaky `TestRedial` test (vitessio#19106) (vitessio#19107) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] binlog_json: fix opaque value parsing to read variable-length (vitessio#19102) (vitessio#19109) Signed-off-by: Nick Van Wiggeren <nick@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] vschema revert: initialize as nil so that nil checks do not pass later (vitessio#19114) (vitessio#19117) Signed-off-by: Nick Van Wiggeren <nick@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Fix `ReloadSchema` incorrectly using `DisableBinlogs` value in `grpctmclient` (vitessio#19085) (vitessio#19129) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Fix cross shard/keyspace joins with derived tables containing a `UNION`. (vitessio#19046) (vitessio#19136) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Arthur Schreiber <arthur@planetscale.com> * [release-22.0] workflows: avoid accidental deletion to routing rules (vitessio#19121) (vitessio#19135) Signed-off-by: Nick Van Wiggeren <nick@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * Pin GitHub Actions and Docker images by hash (vitessio#19151) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Fix column offset tracking for `UNION`s to be case insensitive. (vitessio#19139) (vitessio#19161) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Arthur Schreiber <arthur@planetscale.com> * [release-22.0] VDiff: Prevent division by 0 when reconciling mismatches for reference tables (vitessio#19160) (vitessio#19164) Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Matt Lord <mattalord@gmail.com> * [release-22.0] CI: Look for expected log message rather than code in Backup tests (vitessio#19199) (vitessio#19200) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Update go-upgrade to update docker image digests (vitessio#19178) (vitessio#19188) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Mohamed Hamza <mhamza@fastmail.com> * [release-22.0] Fix sporadic TestServingKeyspaces panic on context cancellation (vitessio#19163) (vitessio#19186) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Fix major upgrade logic in go upgrade tool (vitessio#19211) * [release-22.0] CI: Use new Percona Server repo name (vitessio#19221) Signed-off-by: Matt Lord <mattalord@gmail.com> * [release-22.0] Fix go upgrade workflow (vitessio#19216) (vitessio#19219) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Upgrade the Golang version to `go1.24.12` (vitessio#19222) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: frouioui <35779988+frouioui@users.noreply.github.com> * [release-22.0] VReplication: Properly Handle Sequence Table Initialization For Empty Tables (vitessio#19226) (vitessio#19227) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Matt Lord <mattalord@gmail.com> * [release-22.0] `vtorc`: detect errant GTIDs for replicas not connected to primary (vitessio#19224) (vitessio#19233) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Add new `force` flag to `DemotePrimary` to force a demotion even when blocked on waiting for semi-sync acks (vitessio#18714) (vitessio#19238) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Mohamed Hamza <mhamza@fastmail.com> * [release-22.0] vtorc: add `StaleTopoPrimary` analysis and recovery (vitessio#19173) (vitessio#19236) Co-authored-by: Mohamed Hamza <mhamza@fastmail.com> * [release-22.0] switch end-to-end tests to gotestsum (vitessio#19182) (vitessio#19244) * [release-22.0] evalengine: make `JSON_EXTRACT` work with non-static arguments (vitessio#19035) (vitessio#19253) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] Escape control bytes in JSON strings (vitessio#19270) (vitessio#19274) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> * [release-22.0] evalengine: Fix `NULL` document handling in JSON functions (vitessio#19052) (vitessio#19230) Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> * [release-22.0] Code Freeze for `v22.0.3` (vitessio#19281) Signed-off-by: Matt Lord <mattalord@gmail.com> * [release-22.0] Release of `v22.0.3` (vitessio#19282) Signed-off-by: Matt Lord <mattalord@gmail.com> * Fix remaining conflict markers in CHANGELOG.md Removed conflict markers that were accidentally committed during merge. Both entries are now properly included: 43.5 (golang 1.24.10) and 43.6 (golang 1.24.12). Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Add back GitHub access token setup to vtadmin workflows Re-added the GitHub access token configuration step to both vtadmin workflows that was lost during the v22.0.3 merge. This step is required for accessing private Slack repositories during the build process. Files updated: - .github/workflows/check_make_vtadmin_authz_testgen.yml - .github/workflows/check_make_vtadmin_web_proto.yml Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Add back GitHub access token setup to e2e_race workflow Re-added the GitHub access token configuration step to e2e_race.yml that was lost during the v22.0.3 merge. This step is required for accessing private Slack repositories during the build process. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Add back GitHub access token setup to endtoend workflow Re-added the GitHub access token configuration step to endtoend.yml that was lost during the v22.0.3 merge. This step is required for accessing private Slack repositories during the build process. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Add back GitHub access token setup to unit_test_mysql57 workflow Re-added the GitHub access token configuration step to unit_test_mysql57.yml that was lost during the v22.0.3 merge. This step is required for accessing private Slack repositories during the build process. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Add back GitHub access token setup to unit_test_evalengine_mysql57 workflow Re-added the GitHub access token configuration step to unit_test_evalengine_mysql57.yml that was lost during the v22.0.3 merge. This step is required for accessing private Slack repositories during the build process. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Add GOPRIVATE env variable to MySQL 57 workflow files Added GOPRIVATE environment variable to specify private Go module repositories for both MySQL 57 unit test workflows. This ensures Go can properly access the private slackhq/vitess-addons repository during builds. Files updated: - .github/workflows/unit_test_mysql57.yml - .github/workflows/unit_test_evalengine_mysql57.yml Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Add GOPRIVATE env and GitHub access token to java_docker_test workflow Added both the GOPRIVATE environment variable and GitHub access token configuration step to java_docker_test.yml. These are required for accessing private Slack repositories during the Java Docker test builds. Changes: - Added GOPRIVATE env variable for slackhq/vitess-addons - Added GitHub access token setup step after Set up Go Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Add GOPRIVATE env and GitHub access token to docker_test_cluster workflow Added both the GOPRIVATE environment variable and GitHub access token configuration step to docker_test_cluster.yml. These are required for accessing private Slack repositories during the Docker cluster test builds. Changes: - Added GOPRIVATE env variable for slackhq/vitess-addons - Added GitHub access token setup step after Set up Go Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * fix docker test file Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * fix test Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * fix test runner Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * fix test Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * fix test Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * udpate tests Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Revert query_executor files to pre-merge Slack version Restored query_executor.go and query_executor_test.go to their state before the v22.0.3 merge to preserve Slack-specific customizations and avoid compatibility issues with upstream changes. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Revert vstream_manager files to pre-merge Slack version Restored vstream_manager.go and vstream_manager_test.go to their state before the v22.0.3 merge to preserve critical Slack-specific features: - Transaction chunking to prevent OOM (Out Of Memory) issues with large transactions - Stream liveness monitoring to detect dead streams - Enhanced metrics (vstreamsTransactionsChunked counter) - Detailed VStream flags logging for debugging These features were added to improve reliability and observability of VStream operations and should not be lost in the merge. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Revert smartconnpool waitlist changes from v22.0.3 merge Reverted go/pools/smartconnpool/waitlist.go to pre-merge version and removed the new semaphore implementation files (sema.s, sema_norace.go, sema_race.go). The upstream changes replaced the channel-based waiter implementation with a semaphore-based approach. Reverting to preserve the Slack version's channel implementation. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Add Slack-specific configs to upgrade_downgrade test workflows Updated all 16 upgrade_downgrade test workflows with: - runs-on: vitess-ubuntu24-16cpu-1 (Slack's custom runner) - GOPRIVATE and GH_ACCESS_TOKEN environment variables - GitHub access token setup step before Set up python This ensures proper access to private Slack repositories during CI. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Revert selected upgrade_downgrade workflow files to pre-merge version Reverted 7 workflow files to their state before the v22.0.3 merge to preserve Slack-specific configurations that were present in the original version: - upgrade_downgrade_test_backups_e2e.yml - upgrade_downgrade_test_backups_e2e_next_release.yml - upgrade_downgrade_test_backups_manual_next_release.yml - upgrade_downgrade_test_query_serving_queries_next_release.yml - upgrade_downgrade_test_query_serving_queries_2_next_release.yml - upgrade_downgrade_test_query_serving_schema_next_release.yml - upgrade_downgrade_test_reparent_new_vtctl.yml These files had custom configurations that need to be maintained in the Slack fork. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Revert upgrade_downgrade_test_reparent_new_vttablet.yml to pre-merge version Reverted .github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml to its state before the v22.0.3 merge to preserve Slack-specific configurations. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Revert CODEOWNERS to Slack version Replaced upstream CODEOWNERS with Slack-specific version that assigns all files to @slackhq/vitess-approvers. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Revert vstream_test.go to pre-merge Slack version Reverted go/test/endtoend/vreplication/vstream_test.go to its state before the v22.0.3 merge to preserve Slack-specific test configurations. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Revert Dockerfiles to pre-merge Slack version Reverted docker/lite/Dockerfile.mysql84 and docker/lite/Dockerfile.percona80 to their state before the v22.0.3 merge to preserve Slack-specific configurations: - Use golang:1.24.10-bookworm (without SHA pinning) - Use debian:bookworm-slim (without SHA pinning) - Restore GH_ACCESS_TOKEN setup for private repository access - Restore GOPRIVATE environment variable for github.com/slackhq/vitess-addons Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * update test Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * update test runner Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Add Slack private repo configuration to vttestserver Dockerfiles Restore GitHub access token and GOPRIVATE settings needed for accessing Slack's private vitess-addons repository during Docker builds. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * update tests Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * update tests Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Fix duplicate vtgate_schematracker_viewsdisabled test configuration Remove duplicate test entry that was missing the Packages field and causing 'ERROR: PACKAGES is empty' test failures. Merged RetryMax field from the duplicate into the correct entry. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Fix additional duplicate test configurations Remove duplicate entries for vtgate_foreignkey_routing and vreplication_sequence_reset_on_switch_traffic that were missing the Packages field. Merged RetryMax field from duplicates. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Disable MySQL 5.7 unit tests for Slack branches Add branches-ignore pattern to exclude slack-[0-9]+.[0-9] branches from MySQL 5.7 unit test workflows since Slack no longer supports MySQL 5.7. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Fix workflow syntax: add missing env keyword for environment variables Three workflow files were missing the 'env:' keyword before their environment variable declarations, causing the workflows to be invalid and preventing tests from running. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Update vtop_example workflow to use vitess runner Change from oracle-vm-8cpu-32gb-x86-64 to vitess-ubuntu24-16cpu-1 to align with other workflows in the repository. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Fix GitHub access token setup condition in local_example workflow The Setup GitHub access token step was checking for 'end_to_end' filter output, but the paths-filter only defines 'examples'. This mismatch caused the step to be skipped, preventing authentication for downloading the private vitess-addons module. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Add GitHub access token setup to vtop_example workflow Add GOPRIVATE and GH_ACCESS_TOKEN environment variables, and add the Setup GitHub access token step to authenticate for downloading the private vitess-addons module. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Pass GitHub access token to Docker build in vtop_example test The vtop_example test builds a Docker image using docker/lite/Dockerfile, which needs to authenticate to download the private vitess-addons module. Pass GH_ACCESS_TOKEN as a build argument so the Dockerfile can configure git authentication. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Add GitHub access token setup to bootstrap Docker image The bootstrap Docker image is used for Java tests and needs to authenticate to download the private vitess-addons module during go mod download. Add GH_ACCESS_TOKEN build arg handling and git config setup. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Update cluster_endtoend_xb_backup workflow to use vitess runner Change from ubuntu-24.04 to vitess-ubuntu24-16cpu-1 runner. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * regen workflows Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Update vitess-addons to v0.22.3 and remove wrapper Upgrade github.com/slackhq/vitess-addons from v0.22.1 to v0.22.3. The new version implements HasSemiSync() directly in SlackCrossCell, so the slackCrossCellWrapper is no longer needed. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> --------- Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr> Signed-off-by: Harshit Gangal <harshit@planetscale.com> Signed-off-by: Arthur Schreiber <arthurschreiber@github.com> Signed-off-by: Mohamed Hamza <mhamza15@github.com> Signed-off-by: Andres Taylor <andres@planetscale.com> Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: GitHub <noreply@github.com> Signed-off-by: Rohit Nayak <rohit@planetscale.com> Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Signed-off-by: siddharth16396 <siddharth16396@gmail.com> Signed-off-by: Matt Lord <mattalord@gmail.com> Signed-off-by: Noble Mittal <noblemittal@outlook.com> Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Arthur Schreiber <arthur@planetscale.com> Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Nick Van Wiggeren <nick@planetscale.com> Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> Signed-off-by: ghostframe <marcosandresdiaz@gmail.com> Co-authored-by: vitess-bot <139342327+vitess-bot@users.noreply.github.com> Co-authored-by: Florent Poinsard <florent.poinsard@outlook.fr> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Harshit Gangal <harshit@planetscale.com> Co-authored-by: Mohamed Hamza <mhamza15@github.com> Co-authored-by: Andrés Taylor <andres@planetscale.com> Co-authored-by: frouioui <frouioui@users.noreply.github.com> Co-authored-by: Manan Gupta <manan@planetscale.com> Co-authored-by: Manan Gupta <guptamanan100@gmail.com> Co-authored-by: Noble Mittal <62551163+beingnoble03@users.noreply.github.com> Co-authored-by: Noble Mittal <noblemittal@outlook.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dirkjan Bussink <d.bussink@gmail.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: Arthur Schreiber <arthur@planetscale.com> Co-authored-by: frouioui <35779988+frouioui@users.noreply.github.com> Co-authored-by: Nick Van Wiggeren <nick@planetscale.com> Co-authored-by: Matt Lord <mattalord@gmail.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: Nick Van Wiggeren <nickvanw@users.noreply.github.com> Co-authored-by: Stas Maksimov <maksimov@gmail.com> Co-authored-by: Mohamed Hamza <mhamza@fastmail.com> Co-authored-by: Claude <svc-devxp-claude@slack-corp.com>
Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
Change connection pool idle expiration logic (vitessio#19004)
Description
This pull request changes how idle connection expiration is handled.
#18967 fixed a bug where connection pools could lose track of how many connections are actually active in the pool, but introduced a new issue where idle connections on a connection pool with low frequency would be closed but not removed from the connection stacks. As every connection struct also allocates a
bufio.Readerwith a 16MB buffer size, over time these connections would use a significant chunk of memory, causing the Go Garbage Collector to go into overdrive and consume a lot of CPU resources in turn.This changes the connection pool expiration logic to not modify connections while they're still in a connection stack. Instead, we pop off all the available connections from the stack, quickly filter out the ones that need to be expired and return all the other connections back to the connection pool. Note that we're not interested in the actively used connections - the fact that they are used and not on one of the stacks means that they are not idling and not in need of being expired anyway.
Once we have collected the list of connections to expire, we reopen them one by one, and then return them back to the pool if we could reopen them successfully. If we encounter an error during a reopen operation, we just treat that connection as having been closed (and update the pool to reflect this).
There's some downside to this approach, namely that for very large pools there might be a short moment where all the connections have been popped off the stack and not returned yet - and incoming
getcalls will end up on the waitlist. I don't think this is an issue, because a lot of connections on the stack means low usage of the pool, so it's probably okay for a very short moment to not have any connection on the stack. On a connection pool that's used at a very high frequency, we'll probably only pop off a few connections from the stack - so checking for idle connections should barely be noticeable.Related Issue(s)
PRSfailure #18202Checklist
Deployment Notes
AI Disclosure