This is an automated archive.

The original was posted on /r/mysql by /u/adkud on 2023-08-17 17:32:08+00:00.


I’ve had this problem in two separate stacks on two separate versions of mysql (5.7 and 8.0). I build REST APIs and often there’s a pattern where a request writes some data to the db, then client gets that back and immediately makes a request again that assumes the data is there. But sporadically the newly written data will not be visible for up to a second or so later. The first request commits the transaction. I’ve tried different transaction isolation levels. I’ve written code on the second request that will wait for the expected data to become visible. But what gives here? I thought once a transaction is committed, all subsequent reads should see the new data.

I’m not using a read replica, I’m sure the transaction is committed because I manually commit it in the orm , and I’m not using any asynchronous operations.