-
Notifications
You must be signed in to change notification settings - Fork 5
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
Read-only endpoints problem #214
Comments
@dragomirp can you please comment it here. IMHO, we should notify client on the endpoints change... always. Is the UNIX SOCKET pgb concept affects us here? |
BTW, on the reported image the pgboucer/1 exposed port, but pgbouncer/2 didn't. why? |
When there's no external node connectivity, client units are only supposed to use the local subordinated pgbouncer. There's no place to set a read only database name in the interface and, as is, accessing those requires the client charm to be aware of the _readonly databases. To be able to have meaningful read only endpoints, we'll need to add another PGB read only instance serving on a different port, since that can be different in the interface. With data integrator we'd have the inverse problem, if we provide real readonly endpoint (on a different port), there would be no way to get all available RW endpoints without that the client has to switch ports. This is preexisting behaviour, since before the charm was made subordinate. |
Hi! I've discovered some weird behavior with read-only-endpoints.
Steps to reproduce
Model:
Pgbouncer always includes read-only channel in its config upon different database name (main database name +
_readonly
suffix) if there are postgresql replicas. (example below is on data-integrator/1)But pgbouncer does not notify client application about read-only-endpoints if it's not exposed (
external-node-connectivity
).And even when it exposed, it notifies client application with
read-only-endpoints
pointing to each non-leader pgbouncer unit IP.Expected behavior
Pgbouncer always must provide application with both RW and read-only channels if there are postgresql replicas active. And, i assume, there is need to move read-only channel to different endpoint, because postgresql_client/v0 assumes that database name will be the same and only endpoint is different.
Actual behavior
When not exposed, pgbouncer will ignore read-only channel, so that application just can't use postgresql replicas.
And when exposed, app will put all the non-leader pgbouncer unit IPs into
read-only-endpoints
(but it has nothing to do with read-only channels to postgresql replicas, it just another pgbouncer units pointing to the same primary).Versions
Operating system: Ubuntu 23.10
Juju CLI: 3.4.2-genericlinux-amd64
Juju agent: 3.4.0
postgresql charm revision: edge (rev. 393)
pgbouncer charm revision: 1/edge (rev. 142)
LXD: 5.21.1 LTS
The text was updated successfully, but these errors were encountered: