InnoDB磁盘架构之双写缓冲区

在这里插入图片描述

1 问题背景

前面研究了InnoDB磁盘架构之表空间,今天来研究双写缓冲区。

2 回顾

InnoDB架构如下图所示:

在这里插入图片描述

3 双写缓冲区

原文
The doublewrite buffer is a storage area where InnoDB writes pages flushed from the buffer pool before writing the pages to their proper positions in the InnoDB data files. If there is an operating system, storage subsystem, or unexpected mysqld process exit in the middle of a page write, InnoDB can find a good copy of the page from the doublewrite buffer during crash recovery.

双写缓冲区是一个存储区域,在InnoDB将页写到InnoDB数据文件的正确位置之前,InnoDB将页从缓冲池写到该区域(双写缓冲区)。如果在页面写入的过程中存在操作系统,存储子系统或者意外的mysqld进程退出,InnoDB可以在崩溃恢复期间从双写缓冲区找到一个完整的页面副本。

原文
Although data is written twice, the doublewrite buffer does not require twice as much I/O overhead or twice as many I/O operations. Data is written to the doublewrite buffer in a large sequential chunk, with a single fsync() call to the operating system (except in the case that innodb_flush_method is set to O_DIRECT_NO_FSYNC).

即使数据被写了两次,双写缓冲区不需要两倍的I/O开销或者两倍的I/O操作。数据以大顺序块的形式被写进双写缓冲区中,只需fsync()调用一次操作系统(innodb_flush_method被设置成O_DIRECT_NO_FSYNC的情况除外)。

原文
Prior to MySQL 8.0.20, the doublewrite buffer storage area is located in the InnoDB system tablespace. As of MySQL 8.0.20, the doublewrite buffer storage area is located in doublewrite files.

在 MySQL 8.0.20 之前,双写缓冲区存储区位于InnoDB系统表空间中。从 MySQL 8.0.20 开始,双写缓冲区存储区域位于双写文件中。

双写缓冲区详情配置见Doublewrite Buffer

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值