>From reading the docs, a binary log is an efficient representation of all
data-modifying SQL that is run on the master database. I was unable to
figure out what happens if a slave is interrupted while in the middle of
processing a binary log.

When a binary log is applied to a slave database, what happens if the
machine or database dies half way through the log?

For example, with InnoDB, say the following statements are run and stored in
the binary log:

---------------------------
1) INSERT INTO table_a (column_a, column_b, ...) VALUES (...);

2) COMMIT;

3) UPDATE table_a SET column_b = 'some_value' WHERE column_c =
'something_else';

4) COMMIT;
-----------------------------

The slave-machine (also using InnoDB tables) start processing the binary
log. Statement 1 and 2 are processed, but it dies before Statement 3 (UPDATE
table_a...) is executed.

If you restart the slave, would it start the binary log back at the
beginning, or is the offset inside the file stored in the database so that
the slave database starts at Statement 3? Or would the whole log be
re-processed (potentially causing problems with inserting rows with unique
keys)?

How does this work with MyISAM?

Thanks,
David

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to