Details
-
New Feature
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
In many cases, application encapsulate all the statements in transactions, so these applications cannot use read write split service which provided by mxs;
In MySQL 5.7 or MariaDB, server provided session track mechanism(https://dev.mysql.com/worklog/task/?id=6631),this mechanism can help divide the statements in a transaction into two groups,the ones which cannot be route to slaves (writes, and the reads after writes), and the another ones which can not be route to slaves(reads before any write);
Proposal:
use SESSION_TRACK_TRANSACTION_CHARACTERISTICS to get current session isolation level;
use SESSION_TRACK_TRANSACTION_STATE to find tranaction boundry;
if current session in RC Mode and "not real in a transacion", and target statment's type is read, so this statment can be route to slave;
mxs can provide a session variable to enable this route behavior;