doublewrite-buffer · shipping · also InnoDB doublewrite, innodb_doublewrite

Doublewrite buffer

An InnoDB doublewrite buffer stages data-page copies before their final file writes so crash recovery can repair an incomplete page write.

Related Observatory article: Read on hesela.com

MySQL 8.4 ON and DETECT_AND_RECOVER preserve page content, while DETECT_ONLY preserves metadata without repair bytes. Changes among these enabled modes can be dynamic, but switching between an enabled mode and OFF cannot. [4]

In mysql-8.4.0, reduced entries contain tablespace ID, page number and LSN. Recovery can fail on a corrupt page when no full copy has repaired it. A recorded page identity is not a recovery image. [3]

Redo logging remains separate: it records changes for replay, whereas the staged page supplies reconstruction material. A successfully repaired page does not decide whether its transaction committed. [2] [5]

Relations

related
Torn write, Full-page write, Write-ahead log, Database checkpoint, Crash consistency, Crash-corruption ambiguity

Advantages

  • Sequential batching shares synchronization work across pages instead of requiring a separate flush per staged page. [1]

Limitations

  • Additional page writes consume bandwidth; the mechanism is not an independent backup or protection against every corruption source. [1]

Citations

  1. MySQL 8.4: Doublewrite Buffer, page-copy recovery and batched writes (accessed 2026-10-16)
  2. MySQL 8.4: Redo Log, recovery records and checkpoint progress (accessed 2026-10-16)
  3. MySQL mysql-8.4.0: buf0dblwr.cc, reduced_recover and page recovery (accessed 2026-10-16)
  4. MySQL 8.4: InnoDB variables, innodb_checksum_algorithm and innodb_doublewrite (accessed 2026-10-16)
  5. MySQL 8.4: InnoDB Recovery, redo application and background transaction rollback (accessed 2026-10-16)

Further reading

  1. Hesela: WAL, checkpoints and torn pages, InnoDB doublewrite (accessed 2026-10-16)
Sources & caveats
  • Behavior is scoped to the MySQL 8.4 manual and mysql-8.4.0 implementation, not all engines or future releases.
  • The description is a documentation and code review, not a power-loss experiment or throughput benchmark.

JSON: /data/terms/doublewrite-buffer.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Doublewrite buffer. Hesela. 2026-10-16. https://hesela.dev/terms/doublewrite-buffer/