I own the following classical MySQL 5.7 set-up :
- one master server
- one slave server
The master => slave link is done though GTID. I'm monitoring the link by querying
show slave status on the slave node every minute: if the content of Slave_IO_Running or Slave_SQL_Running is different than "yes", I send an alert.
Actually, the slave is only a kind of real-time backup but not used for querying. I'd like to enable the JDBC Master/Slave Replication as described in the Connector/J documentation in order to better distribute the use of my hardware resources and improve query performance.
But, before editing my JDBC URL, there is one point I need to ensure. Previously, my Master/Slave link was broken (Slave_SQL_Running was set to "no", they were replication errors). When it happened, it was still possible to query the slave. I had fixed the issue by restoring slave from a master dump and my Master/Slave link was back, but for a time slice (some hours) the slave data was not correct and it was possible to query it.
Do you know how Connector/J handles this case when the Slave is not synchronized with the master but still answers to queries?
What kind of measures can I implement to prevent incoherent data (for example wrong read on slave wrong data and then write on master)?