Innodb的三把刀之一的DW

lff1530983327發表於2022-10-28

The  innodb_doublewrite variable controls whether the doublewrite buffer is enabled. It is enabled by default in most cases. To disable the doublewrite buffer, set  innodb_doublewrite to  OFF. Consider disabling the doublewrite buffer if you are more concerned with performance than data integrity, as may be the case when performing benchmarks, for example.

From MySQL 8.0.30,  innodb_doublewrite supports  DETECT_AND_RECOVER and  DETECT_ONLY settings.

The  DETECT_AND_RECOVER setting is the same as the  ON setting. With this setting, the doublewrite buffer is fully enabled, with database page content written to the doublewrite buffer where it is accessed during recovery to fix incomplete page writes.

With the  DETECT_ONLY setting, only metadata is written to the doublewrite buffer. Database page content is not written to the doublewrite buffer, and recovery does not use the doublewrite buffer to fix incomplete page writes. This lightweight setting is intended for detecting incomplete page writes only.

MySQL 8.0.30 onwards supports dynamic changes to the  innodb_doublewrite setting that enables the doublewrite buffer, between  ONDETECT_AND_RECOVER, and  DETECT_ONLY. MySQL does not support dynamic changes between a setting that enables the doublewrite buffer and  OFF or vice versa.

If the doublewrite buffer is located on a Fusion-io device that supports atomic writes, the doublewrite buffer is automatically disabled and data file writes are performed using Fusion-io atomic writes instead. However, be aware that the  innodb_doublewrite setting is global. When the doublewrite buffer is disabled, it is disabled for all data files including those that do not reside on 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  innodb_flush_method setting of  O_DIRECT is recommended.

8.0.30之後,支援   DETECT_AND_RECOVER  and  DETECT_ONLY設定,前者和on設定一樣。

後者表示只記錄後設資料資訊到DW中,只是用來發現不完整的頁。


Fusion-io裝置支援原子寫,DW會自動關閉。只是在Fusion-io硬體上並且只會在Linux的Fusion-io NVMES上開啟

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30018455/viewspace-2920949/,如需轉載,請註明出處,否則將追究法律責任。

相關文章