mariadb/storage/innobase/btr
Marko Mäkelä 147d4b1ec0 MDEV-21347 innodb_log_optimize_ddl=OFF is not crash safe
In commit 0f90728bc0 (MDEV-16809)
we introduced the configuration option innodb_log_optimize_ddl
for controlling whether native index creation or table-rebuild
in InnoDB should avoid writing full redo log.

Fungo Wang reported that this option is causing occasional failures.
The reason is that pages may be written to data files in an
inconsistent state. Applying log records to such inconsistent pages
may fail.

The solution is to always invoke PageBulk::finish() before page latches
may be released, to ensure that the page contents is in a consistent
state.

Something similar was implemented in MySQL 8.0.13:
mysql/mysql-server@d1254b9473

buf_block_t::skip_flush_check: Remove. Suppressing consistency checks
is a bad idea.

PageBulk::needs_finish(): New predicate: Determine whether
PageBulk::finish() must fix up the page.

PageBulk::init(): Clear PAGE_DIRECTION to ensure that needs_finish()
will hold. We change the field from PAGE_NO_DIRECTION to 0
and back without writing redo log. This trick avoids the need
to introduce any new data member to PageBulk.

PageBulk::insert(): Replace some high-level accessors to bypass
debug assertions related to PAGE_HEAP_TOP that we will be violating
until finish() has been executed.

PageBulk::finish(): Tolerate m_rec_no==0. We must invoke this also
on an empty page, to ensure that PAGE_HEAP_TOP is initialized.

PageBulk::commit(): Always invoke finish().

PageBulk::release(), BtrBulk::pageSplit(), BtrBulk::storeExt(),
BtrBulk::finish(): Invoke PageBulk::finish().
2020-07-16 06:35:15 +03:00
..
btr0btr.cc MDEV-22456 Dropping the adaptive hash index may cause DDL to lock up InnoDB 2020-05-15 17:23:08 +03:00
btr0bulk.cc MDEV-21347 innodb_log_optimize_ddl=OFF is not crash safe 2020-07-16 06:35:15 +03:00
btr0cur.cc MDEV-20377: Make WITH_MSAN more usable 2020-07-01 17:23:00 +03:00
btr0defragment.cc MDEV-21595: innodb offset_t rename to rec_offs 2020-04-29 12:02:47 +03:00
btr0pcur.cc MDEV-22456 Dropping the adaptive hash index may cause DDL to lock up InnoDB 2020-05-15 17:23:08 +03:00
btr0scrub.cc MDEV-21595: innodb offset_t rename to rec_offs 2020-04-29 12:02:47 +03:00
btr0sea.cc MDEV-22790 Race between btr_page_mtr_lock() dropping AHI on the same block 2020-06-05 15:22:46 +03:00