-
Notifications
You must be signed in to change notification settings - Fork 170
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
ERROR: DISCARD ALL cannot run inside a transaction block when connection closed uncleanly #64
Comments
@drdrsh Hey, tried to fix it in #65, hope it helps. I couldn't reproduce it locally, as is tradition with Postgres connection abnormalities :) Worst case we can just close the connection instead of re-using it, but that takes us back to Pgbouncer connection thrashing which we don't want, so if you come up with the root cause and solution, it would be awesome. |
That fix worked. I am not able to reproduce this anymore. |
@levkk I think I understand what happened here. Docs for
This behavior can be demonstrated in ruby by doing the following
This will fail with |
Very nice find! Thank you. |
…ation (#618) * Initial commit * Cleanup and add stats * Use an arc instead of full clones to store the parse packets * Use mutex instead * fmt * clippy * fmt * fix? * fix? * fmt * typo * Update docs * Refactor custom protocol * fmt * move custom protocol handling to before parsing * Support describe * Add LRU for server side statement cache * rename variable * Refactoring * Move docs * Fix test * fix * Update tests * trigger build * Add more tests * Reorder handling sync * Support when a named describe is sent along with Parse (go pgx) and expecting results * don't talk to client if not needed when client sends Parse * fmt :( * refactor tests * nit * Reduce hashing * Reducing work done to decode describe and parse messages * minor refactor * Merge branch 'main' into zain/reimplment-prepared-statements-with-global-lru-cache * Rewrite extended and prepared protocol message handling to better support mocking response packets and close * An attempt to better handle if there are DDL changes that might break cached plans with ideas about how to further improve it * fix * Minor stats fixed and cleanup * Cosmetic fixes (#64) * Cosmetic fixes * fix test * Change server drop for statement cache error to a `deallocate all` * Updated comments and added new idea for handling DDL changes impacting cached plans * fix test? * Revert test change * trigger build, flakey test * Avoid potential race conditions by changing get_or_insert to promote for pool LRU * remove ps enabled variable on the server in favor of using an option * Add close to the Extended Protocol buffer --------- Co-authored-by: Lev Kokotov <levkk@users.noreply.github.com>
Describe the bug
I am working on a test bench to test some edge cases against pgcat. Opening a transaction and then closing the client connection causes pgcat to issue
ROLLBACK; DISCARD ALL
, however this behavior triggersERROR: DISCARD ALL cannot run inside a transaction block
error on the server. Might be something wrong with my setup or an issue with pgcatTo Reproduce
Put the following 3 files in the same directory and run
docker compose up
docker-compose.yml
entrypoint.rb
config.toml
Expected behavior
No server errors.
The text was updated successfully, but these errors were encountered: