Don't recycle connections on RELOAD if TLS config is unchanged#1157
Conversation
|
3 out of 4 of my new tests fail in CI under a Maybe I'm missing a marker/annotation. 👀 |
|
Okay, moved my tests into |
2d10623 to
73adecd
Compare
JelteF
left a comment
There was a problem hiding this comment.
Overall looks like a good improvement. Currently we indeed recycle connections way too aggressively when TLS is enabled.
9e5aa5a to
129a01b
Compare
In pgbouncer, we'd like to be able to compare TLS configs for equality to avoid over-aggressive connection recycling. Since knowledge about the structure for these configs live here it seems best to implement that here. Original PR: pgbouncer/pgbouncer#1157
…-> test_ssl so they are only run with SSL tests in CI
…ol marking dirty' tls specs
… is checking out a connection and also at the full_maint_period
…ess agressive RELOAD connection recycling
…air is not checked
1c373c5 to
a9d1859
Compare
In pgbouncer, we'd like to be able to compare TLS configs for equality to avoid over-aggressive connection recycling. Since knowledge about the structure for these configs live here it seems best to implement that here. Original PR: pgbouncer/pgbouncer#1157
dabc457 to
60e8d71
Compare
60e8d71 to
58b77a5
Compare
|
Hey @JelteF I think I've addressed any outstanding feedback. I did force push the branch on Wednesday to rewrite my git ùser.email`. Sorry if that was bad form or made reviewing the final state of this harder. I presume we need to wait for my outstanding libusual PR to be reviewed/merged to get this pull merged? Any tips on getting the libusual PR reviewed? Thanks for being so responsive and helpful in getting this operational bottleneck in pgbouncer solved. |
In pgbouncer, we'd like to be able to compare TLS configs for equality to avoid over-aggressive connection recycling. Since knowledge about the structure for these configs live here it seems best to implement that here. Original PR: pgbouncer/pgbouncer#1157
All PgBouncer committers also have commit access on libusual (including me). So this should be fine. But yeah we should merge that one first. |
In pgbouncer, we'd like to be able to compare TLS configs for equality to avoid over-aggressive connection recycling. Since knowledge about the structure for these configs live here it seems best to implement that here. Original PR: pgbouncer/pgbouncer#1157
|
@JelteF I've branched a cleanup from this to remove |
|
CI is reporting a failure on one of the newly added tests, looks like it's flaky since only one of the linux builds is hitting the issue. |
In pgbouncer, we'd like to be able to compare TLS configs for equality to avoid over-aggressive connection recycling. Since knowledge about the structure for these configs live here it seems best to implement that here. Original PR: pgbouncer/pgbouncer#1157
|
I haven't had success with any specs at all with valgrind enabled locally today to repro but will give it another try tonight |
|
Okay @JelteF these specs were genuinely flaky due to timing issues between
This isn't incorrect behavior. Updating the expectation to avoid this: e27c774 |
…be done by operators
`full_maint_period` refreshes clients checking out a connection. This spec was one that didn't sleep for `full_maint_period` and didn't expect that style of refresh from the logs but got one: ```2024-09-08 18:04:35.379 UTC [12865] LOG S-0x53ccd50: pTxnPool/bouncer@127.0.0.1:10201 closing because: database configuration changed (age=0s) ``` This isn't incorrect behavior. This commit updates the expectation to avoid this issue.
dfd74cb to
3b76c63
Compare
|
Any further changes needed @JelteF ? |
This addresses #1145.
We run pgbouncers client-side that connect to 80+ databases. Separately we are addressing this bottleneck by running more pgbouncers client-side and striping them but in order to eliminate the unnecessary queuing that this kind of aggressive connection recycling can cause I propose taking a more judicious approach.
Essentially, I propose:
It's kind of gross that I have to inspect each member of the lengthy TLS config struct. Comments in-line.