欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

InnoDB On-Disk Structures(四)--Doublewrite Buffer (转载)

程序员文章站 2022-04-20 18:08:50
转载、节选于 https://dev.mysql.com/doc/refman/8.0/en/innodb-doublewrite-buffer.html The doublewrite buffer is a storage area located in the system tablespac ......

转载、节选于 

 

the doublewrite buffer is a storage area located in the system tablespace where innodb writes pages that are flushed from the innodb buffer pool, before the pages are written to their proper positions in the data file. only after flushing and writing pages to the doublewrite buffer, does innodb write pages to their proper positions. if there is an operating system, storage subsystem, or mysqld process crash in the middle of a page write, innodb can later find a good copy of the page from the doublewrite buffer during crash recovery.

although data is always 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 itself as a large sequential chunk, with a single fsync() call to the operating system.

the doublewrite buffer is enabled by default in most cases. to disable the doublewrite buffer, set  to 0.

if system tablespace files (ibdata files”) are located on fusion-io devices that support atomic writes, doublewrite buffering is automatically disabled and fusion-io atomic writes are used for all data files. because the doublewrite buffer setting is global, doublewrite buffering is also disabled for data files residing on non-fusion-io hardware. this feature is only supported on fusion-io hardware and is only enabled for fusion-io nvmfs on linux. to take full advantage of this feature, an setting of o_direct is recommended.

 

转载、节选于