Quantcast
Channel: MySQL Forums - Replication
Viewing all articles
Browse latest Browse all 1562

Can the slave get ahead of the master? (no replies)

$
0
0
Based on this line in the docs:
"Binary logging is done immediately after a statement completes but before any locks are released or any commit is done."
http://dev.mysql.com/doc/refman/5.1/en/binary-log.html
and the fact that the docs seem to imply that binlog events are sent to the slaves as soon as they are _written_, does this mean that there is the possibility that the slave will execute a command that has not committed on the master?

The execution timing I'm thinking of is:
1) Master receives a COMMIT statement
2) Master writes all the binlog entries for that transaction
3) Slave pulls new binlog events from master
4) Slave executes and commits this transaction
5) Master commits this transaction

The problem with this execution is that the master could crash between 3) and 5), and then the slave is out of sync with where the master will recover to. Ideally the master won't give out binlog events until after it has committed them, but this doesn't seem to be guaranteed anywhere I could find.

Viewing all articles
Browse latest Browse all 1562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>