TimeBetweenLocalCheckpoints (redo undo)

Date Node参数 TimeBetweenLocalCheckpoints,默认值为 2000,范围是:20-32000

When a transaction is committed, it is committed in main memory in all nodes on which the data is mirrored. However, transaction log records are not flushed to disk as part of the commit. The reasoning behind this behavior is that having the transaction safely committed on at least two autonomous host machines should meet reasonable standards for durability.

It is also important to ensure that even the worst of cases—a complete crash of the cluster—is handled properly. To guarantee that this happens, all transactions taking place within a given interval are put into a global checkpoint, which can be thought of as a set of committed transactions that has been flushed to disk. In other words, as part of the commit process, a transaction is placed in a global checkpoint group. Later, this group's log records are flushed to disk, and then the entire group of transactions is safely committed to disk on all computers in the cluster.

说到这里,我们有必要去回顾一下MySQL的 redo 和 undo。

MySQL-Cluster存储引擎 NDB 支持事务,每次做数据变更时,将数据和索引都放在内存缓冲池中,而不是直接更新到磁盘上,这样大大避免了I/O请求,也避免了磁头不断的重新定位所花费的时间,这样大大提高了读写速度。所以每当NDB处理完一个事务之后就添加一条日志LOG,其它线程负责读取日志文件并指更新到磁盘,达到最高效的磁盘写入。

在数据恢复的时候,会将已经提交的事务标记并放入redo队列(正向扫描),未完成的事务放入undo队列(反射扫描),用redo和undo这两个日志文件来记录相关信息。我们在每次事务提交的时候会将更改操作记录到redo log。

你可能感兴趣的:(local)