SET SESSION wsrep_sync_wait=1; does not seem to create a sticky connection. Subsequent SELECTs can be routed to other hosts, making impossible to enforce causal reads.
Execute SELECT on HG20
It fails randomly with missing rows:
OK: loop index 115 for last insert ID 348 was found!!
############## list of IDs: [{"id":"3"},{"id":"6"},{"id":"9"},{"id":"12"},{"id":"15"},{"id":"18"},{"id":"21"},{"id":"24"},{"id":"27"},{"id":"30"},{"id":"33"},{"id":"36"},{"id":"39"},{"id":"42"},{"id":"45"},{"id":"48"},{"id":"51"},{"id":"54"},{"id":"57"},{"id":"60"},{"id":"63"},{"id":"66"},{"id":"69"},{"id":"72"},{"id":"75"},{"id":"78"},{"id":"81"},{"id":"84"},{"id":"87"},{"id":"90"},{"id":"93"},{"id":"96"},{"id":"99"},{"id":"102"},{"id":"105"},{"id":"108"},{"id":"111"},{"id":"114"},{"id":"117"},{"id":"120"},{"id":"123"},{"id":"126"},{"id":"129"},{"id":"132"},{"id":"135"},{"id":"138"},{"id":"141"},{"id":"144"},{"id":"147"},{"id":"150"},{"id":"153"},{"id":"156"},{"id":"159"},{"id":"162"},{"id":"165"},{"id":"168"},{"id":"171"},{"id":"174"},{"id":"177"},{"id":"180"},{"id":"183"},{"id":"186"},{"id":"189"},{"id":"192"},{"id":"195"},{"id":"198"},{"id":"201"},{"id":"204"},{"id":"207"},{"id":"210"},{"id":"213"},{"id":"216"},{"id":"219"},{"id":"222"},{"id":"225"},{"id":"228"},{"id":"231"},{"id":"234"},{"id":"237"},{"id":"240"},{"id":"243"},{"id":"246"},{"id":"249"},{"id":"252"},{"id":"255"},{"id":"258"},{"id":"261"},{"id":"264"},{"id":"267"},{"id":"270"},{"id":"273"},{"id":"276"},{"id":"279"},{"id":"282"},{"id":"285"},{"id":"288"},{"id":"291"},{"id":"294"},{"id":"297"},{"id":"300"},{"id":"303"},{"id":"306"},{"id":"309"},{"id":"312"},{"id":"315"},{"id":"318"},{"id":"321"},{"id":"324"},{"id":"327"},{"id":"330"},{"id":"333"},{"id":"336"},{"id":"339"},{"id":"342"},{"id":"345"},{"id":"348"}]
[!!] Could not properly refetch data, result: false, called with ID: {351}
OK: loop index 117 for last insert ID 354 was found!!
If I change query rules and send both SET and SELECT to HG666 where I have one node != writer, everything works ok. My assumption is that ProxySQL does not create a sticky connection when it sees SET SESSION ... and as a result causality check is enabled on node A while SELECT is send to node B, all in the same HG.
SET SESSION wsrep_sync_wait=1; does not seem to create a sticky connection. Subsequent SELECTs can be routed to other hosts, making impossible to enforce causal reads.
Steps to reproduce:
Install ProxySQL:
Configure it to:
On the node install php, php-mysql
Execute following script:
The script does:
If I change query rules and send both SET and SELECT to HG666 where I have one node != writer, everything works ok. My assumption is that ProxySQL does not create a sticky connection when it sees SET SESSION ... and as a result causality check is enabled on node A while SELECT is send to node B, all in the same HG.
ProxySQL log: