proxysql

ProxySQL insert get duplicate entry on PHP 7.4.23 (Silverstripe)


please help

i currently working to setup ProxySQL with 1 master and 2 slave. I have setup mysql_query_rules like this here the image but i tested on mysql client working as expected, insert goes to master and select goes to slave. but when i connect my PHP project to ProxySQL i got error when insert anything.

Error insert

My OS : Centos 7 PHP : 7.4.23 (Silverstripe 3) maybe there someone who have experience trouble like this, and have solved.


Solution

  • Finaly solved, this error happen because bug on silverstripe when insert actually insert first to get ID and then update it to fill the field. but when try to update it check the ID first this make the problem because when insert proxysql goes to master, but when select for check ID goes to slave that not yet update by the insert from master because delay. so i use match_digest to query for check the ID and arranged to master hostgroup.