-
Notifications
You must be signed in to change notification settings - Fork 404
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
DuplicatePreparedStatementError not solved for Pgbouncer behind ha settings #239
Comments
Another option is to do cursor.fetch without prepared statements, is that possible? |
Prepared statements are per-session, so theoretically there should not be a collision when phbouncer is in the session mode. Is there an easy way to replicate your setup? |
Unfortunately I cannot think of an easy way to replicate, the architecture is very tied to Kubernetes so in order to get something similar you have to setup a local K8s cluster (minikube, etc.), then installing this chart should do the full setup and create the proxies: besides that, thinking of a pgbouncer instance targeting a TCP proxy balancer in front of the 5 nodes for reads, through a single IP, is the scenario we are facing. Pgbouncer has not any reset query parameters set other than the default. We are doing our internal investigations on the fact that pgbouncer declares more client connections/sessions than real server connections/sessions, may this be the cause |
So you have another balancer behind pgbouncer? |
uvloop?:
I don't think so
The problem is persisting when a cluster setup (stolon-ha in Kubernetes) is configured. This is the configuration:
My guess: proxies (above all round robin slaves) ara a "single connection" that round robins by TCP to all the nodes, so I don't know what's going on but it started to raise this error in the 25% of read queries, what is pretty annoying, all other environments with a single node and a single server pgbouncer works. Should there be a more robust statement name generation so the names have a real random component? that is avoid that 2 processes can clash into the same name (even if in ideal conditions this would mean no problem because you can detect it or whatever). I think random statement names would solve most of the issues, asyncpg_stmt_N_XXXX would avoid that two asyncpg_stmt_8* clashes in these edge cases.
The text was updated successfully, but these errors were encountered: