krowinski / php-mysql-replication

Pure PHP Implementation of MySQL replication protocol. This allow you to receive event like insert, update, delete with their data and raw SQL queries.
MIT License
319 stars 94 forks source link

Rare race condition suspected #91

Open quakemmo opened 2 years ago

quakemmo commented 2 years ago

Please provide the following details.

OS: Linux Debian 12 PHP: 8.1 php-mysql-replication: 7.0.1 8.0.27 - Oracle MYSQL

On a rare occasion, maybe once every 1000 times, an INSERT event will be triggered by php-mysql-replication, but an immediate SELECT query on the unique ID (passed in the insert values) will return no rows. The same SELECT query will return a row if subsequently entered manually.

Is the INSERT event first sent to the binlog and THEN to the actual MySQL engine? It feels like there's a race condition there.

Transactions are not used in this particular scenario.

krowinski commented 7 months ago

hi, can you replicate this using some code example ?