I learned from this page.
The redo log is a InnoDB log and a Write-Ahead Log (WAL). Two or more redo logs (ib_logfile0, ib_logfile1, ...) are pre-allocated and used in a circular fashion. And they are used to reconstruct changes if necessary (crash recovery).
- Every data change is written to the redo log buffer as the table data is modified.
- The redo log buffer is written to disk (but not synced) when each page modification is complete.
- The redo log is synced to disk up to a the page's modification LSN before a page can be flushed to disk.
- Depending on
innodb_flush_log_at_trx_commit
, the log may be synced to disk at transaction commit.