Log if database load balancer leaks a transaction
What does this MR do and why?
Describe in detail what your merge request does and why.
This is a first step in solving DB load balancer: Automatic retries may leak qu... (#220242 - closed).
Essentially, we detect the following series of events:
- The database load balancer is in a transaction
- A write query encounters an error that the load balancer believes to be fixable by reconnecting to the database
- The load balancer reconnects (replacing the actual connection behind the connection proxy) and resends the query, but the previous transaction is no longer active, violating transaction semantics.
The included spec shows this behavior.
Screenshots or screen recordings
N/A
How to set up and validate locally
The included spec sets up this scenario so that you don't need to configure database load balancing locally. You can run the spec and verify that the table does not include data from both inserts.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.