Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(compute): Set default application_name for pgbouncer connections (…
…#9973) ## Problem When client specifies `application_name`, pgbouncer propagates it to the Postgres. Yet, if client doesn't do it, we have hard time figuring out who opens a lot of Postgres connections (including the `cloud_admin` ones). See this investigation as an example: https://neondb.slack.com/archives/C0836R0RZ0D ## Summary of changes I haven't found this documented, but it looks like pgbouncer accepts standard Postgres connstring parameters in the connstring in the `[databases]` section, so put the default `application_name=pgbouncer` there. That way, we will always see who opens Postgres connections. I did tests, and if client specifies a `application_name`, pgbouncer overrides this default, so it only works if it's not specified or set to blank `&application_name=` in the connection string. This is the last place we could potentially open some Postgres connections without `application_name`. Everything else should be either of two: 1. Direct client connections without `application_name`, but these should be strictly non-`cloud_admin` ones 2. Some ad-hoc internal connections, so if we see spikes of unidentified `cloud_admin` connections, we will need to investigate it again. Fixes neondatabase/cloud#20948
- Loading branch information
9a4157d
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.
7166 tests run: 6848 passed, 0 failed, 318 skipped (full report)
Flaky tests (2)
Postgres 15
test_pgdata_import_smoke[None-1024-RelBlockSize.MULTIPLE_RELATION_SEGMENTS]
: release-arm64test_pull_timeline[True]
: release-x86-64Code coverage* (full report)
functions
:30.8% (8258 of 26823 functions)
lines
:47.8% (65141 of 136319 lines)
* collected from Rust tests only
9a4157d at 2024-12-04T15:32:13.825Z :recycle: