Details
-
New Feature
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
-
MXS-SPRINT-53
Description
Planned Tasks
- Allow re-connection to master servers
- Allow the master server to change mid-session
Original Issue
The case that we try to solve are very frequent in 3 tiers Java Applications , we have long running connections in a 1 to 1 model majority of connection in state Idle. Loosing the DB backend would generate JDBC errors leaving some application that don't catch exception in a failed situation , despite we could have hidden this to all sessions that have committed just before the failure
Connection context tracking will be used (encoding, variables prepared statement ),
Maxscale maintain session variable keepalive = 0
On event
If tmp table set keepalive = 1
If SP Call set keepalive = 2
If keepalive not in (1,2) and autocomit =1 and statement set keepalive = 0
If keepalive not in (1,2) and autocomit =1 and query=ANY set keepalive = 0
If keepalive not in (1,2) and autocomit =1 and query=BEGIN set keepalive = 3
If keepalive not in (1,2) and autocomit =1 and keepalive = 3 and query=ANY set keepalive = 4
If keepalive not in (1,2) and autocomit =1 and query=COMMIT set keepalive =0
If keepalive not in (1,2) and autocomit =0 and query=COMMIT set keepalive =3
If keepalive not in (1,2) and autocomit =0 and query=ANY set keepalive =4
We can keepalive in keepalive =0 and keepalive=3
If keepalive=3 we need to START TRANSACTION on the new backend