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。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值