maria:bb-10.6-MDEV-29440

Last commit made on 2022-09-06
Get this branch:
git clone -b bb-10.6-MDEV-29440 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.6-MDEV-29440
Repository:
lp:maria

Recent commits

1c730da... by Marko Mäkelä

MDEV-29440 InnoDB instant ALTER TABLE recovery must use READ UNCOMMITTED

In commit 8f8ba758559e473f643baa0a0601d321c42517b9 (MDEV-27234)
the data dictionary recovery was changed to use READ COMMITTED
so that table-rebuild operations (OPTIMIZE TABLE, TRUNCATE TABLE,
some forms of ALTER TABLE) would be recovered correctly.

However, for operations that avoid a table rebuild thanks to
being able to instantly ADD, DROP or reorder columns, recovery
must use the READ UNCOMMITTED isolation level so that changes to
the hidden metadata record can be rolled back.

We will detect instant operations by detecting uncommitted changes
to SYS_COLUMNS in case there is no uncommitted change of SYS_TABLES.ID
for the table. In any table-rebuilding DDL operation, the SYS_TABLES.ID
(and likely also the table name) will be updated.

As part of rolling back the instant ALTER TABLE operation, after the
operation on the hidden metadata record has been rolled back, a rollback
of an INSERT into SYS_COLUMNS in row_undo_ins_remove_clust_rec() will
invoke trx_t::evict_table() to discard the READ UNCOMMITTED definition
of the table. After that, subsequent recovery steps will load and use
the correct table definition.

4318391... by Marko Mäkelä

Merge 10.5 into 10.6

c0470ca... by Marko Mäkelä

MDEV-29471 Buffer overflow in page_cur_insert_rec_low()

In commit 244fdc435da364aea3b6e55835115cc04fe3297f (MDEV-29438)
we made sure that if the preceding record is the page infimum record,
no more than 8 bytes will be read from it. But, if the data payload of
the being-inserted record is less than 8 bytes (this can happen in
secondary indexes), we must not compare all 8 bytes.

This was caught by a failure of the test gcol.innodb_virtual_basic
under MemorySanitizer and some builds with AddressSanitizer.

027a996... by Marko Mäkelä

MDEV-13542 fixup: Allow purge to run in a test

19de8b7... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-28240 InnoDB Temporary Tablespace (ibtmp1) is continously growing

- This is caused by commit 1bd681c8b3c5213ce1f7976940a7dc38b48a0d39(MDEV-25506)
InnoDB removes the index from the table object before freeing the
leaf and non-leaf segments.

fd8dbe0... by Daniel Black

MDEV-29443: prevent uring access to galera sst /notify scripts

The resources like uring in MariaDB aren't intended for spawned
processes so we restrict access using the io_uring_ring_dontfork
liburing library call.

9fefd44... by Jan Lindström

Merge 10.5 into 10.6

ba987a4... by Jan Lindström

Merge 10.4 into 10.5

3c7887a... by Marko Mäkelä

Merge 10.5 into 10.6

244fdc4... by Marko Mäkelä

MDEV-29438 Recovery or backup of instant ALTER TABLE is incorrect

This bug was found in MariaDB Server 10.6 thanks to the
OPT_PAGE_CHECKSUM record that was implemented
in commit 4179f93d28035ea2798cb1c16feeaaef87ab4775 for catching
this type of recovery failures.

page_cur_insert_rec_low(): If the previous record is the page infimum,
correctly limit the end of the record. We do not want to copy data from
the header of the page supremum. This omission caused the incorrect
recovery of DB_TRX_ID in an instant ALTER TABLE metadata record, because
part of the DB_TRX_ID was incorrectly copied from the n_owned of the
page supremum, which in recovery would be updated after the copying,
but in normal operation would already have been updated at the time the
common prefix was being determined.

log_phys_t::apply(): If a data page is found to be corrupted, do not
flag the log corrupted but instead return a new status APPLIED_CORRUPTED
so that the caller may discard all log for this page. We do not want
the recovery of unrelated pages to fail in recv_recover_page().

No test case is included, because the known test case would only work
in 10.6, and even after this fix, it would trigger another bug in
instant ALTER TABLE crash recovery.