Open lihongjie0209 opened 3 years ago
During life time of a mtr, a log of changes is collected inside an internal buffer of the mtr. It contains multiple log records, which describe changes applied to possibly different modified pages. When the mtr is committed, all the log records are written to the log buffer within a single group of the log records. Procedure:
在commit之前先写入mtr的buff, commit的时候写入redo buff
The redo log is a write ahead log of changes applied to contents of data pages. It provides durability for all changes applied to the pages. In case of crash, it is used to recover modifications to pages that were modified but have not been flushed to disk.
Every change to content of a data page must be done through a mini transaction (so called mtr - mtr_t), which in mtr_commit() writes all its log records to the redo log.
每次对内存中的页变更都会写入redolog