Skip to content
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

Fix COMMIT|ROLLBACK forwarding to backend connections - Closes #4264 #4306

Merged
merged 5 commits into from
Jul 31, 2023

Conversation

JavierJF
Copy link
Collaborator

This PR fixes the routing of COMMIT|ROLLBACK to backend connections, imposing a priority for it based on the connections potential transaction statuses:

  1. Connections flagged with SERVER_STATUS_IN_TRANS, or autocommit=0 when autocommit_false_is_transaction is set.
  2. Connections with autocommit=0 holding a SAVEPOINT.
  3. Connections with unknown transaction status, e.g: connections with errors.

These commands are now forwarded to the backend connections from a
session with potential transaction statuses, using the following
priority order:
  1. Connections flagged with 'SERVER_STATUS_IN_TRANS', or
     'autocommit=0' when 'autocommit_false_is_transaction' is set.
  2. Connections with 'autocommit=0' holding a 'SAVEPOINT'.
  3. Connections with 'unknown transaction status', e.g: connections
     with errors.
- General testing for 'COMMIT|ROLLBACK' routing.
- Add multiple testing utility functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants