Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Won't Fix
-
3.1.4
-
None
-
None
-
Aurora on AWS
Description
A client reported an issue about unscheduled failovers not working with MariaDB Connector/C, where our app using the connector had to be restarted (they said to pick up a DNS change, which seems suspect), so we started researching Aurora and came across the Aurora plugin.
In aurora_command() I found some troubling code that appears to direct all queries to replica nodes, but if you're inside a SERIALIZABLE transaction, clearly this would be very very bad. It also appears to send all STMT PREPARE requests to a replica which too does not make sense.
Relevent line in code
The author appears to have wanted to use some sort of automated load balancing for read requests but that simply isn't feasible. If the code is modified to ONLY ever send commands to the primary, then this plugin should work for failover events since it should re-query other known members to see which one is now primary and fail over to it ... thus not relying on the AWS DNS-based failover.
I should note I have not tested the plugin as I do not have access to an aurora instance, so I am going solely of a code review .... but it seems pretty straight forward.