posted by Sakila The Librarian
on
Mon 07 Sep 2009 12:11 UTC
Tags:
(
edit)
mysql,
recovery,
innodb,
transactional logs,
undo log,
redo log,
transaction logging,
acid,
falcon,
Keith Murphy,
Pythian
I was doing some research over the weekend on how transactions work "under the hood" in MySQL. I thought it might be enlightening if I wrote about what I found.The database system must resolve the situation where, for whatever reason, the database server stops working in the middle of a transaction. Perhaps the power goes out, the hard drive crashes, or the CPU disappears in a cloud of smoke. Maybe the MySQL Server itself crashes for some reason. What does the MySQL Server do when operation resumes? Potentially, there are transactions in an inconsistent state. How are inconsistent transactions resolved? They are resolved through a recovery process involving log files that are called transactional logs. There are two kinds of transactional logs: redo logs and undo logs.