maria:bb-10.6-MDEV-29336

Last commit made on 2022-08-22
Get this branch:
git clone -b bb-10.6-MDEV-29336 https://git.launchpad.net/maria

Branch merges

Branch information

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

Recent commits

6251ae4... by Marko Mäkelä

Merge 10.6

9528271... by Marko Mäkelä

Merge

d65a2b7... by Marko Mäkelä

Merge 10.5 into 10.6

1d90d68... by Marko Mäkelä

Merge 10.4 into 10.5

36d173e... by Marko Mäkelä

Merge 10.3 into 10.4

6005f3c... by Marko Mäkelä

MDEV-25257 follow-up: Fix a test

Ever since commit 09177eadc39ae1e777ad473970456cb9dd9c3993
the test innodb.row_format_redundant cannot work when the
data file was created with innodb_checksum_algorithm=full_crc32.

Backport of 10.5 commit a9d0bb12e68a11c119a3534f354c7a7ef13dd5b5

fd0cd48... by Marko Mäkelä

MDEV-13013 fixup: Adjust a test

dd88cbe... by Marko Mäkelä

Merge

3e69e27... by Marko Mäkelä

MDEV-29336: Potential deadlock in btr_page_alloc_low() with the AHI

The index root page contains the fields BTR_SEG_TOP and BTR_SEG_LEAF
which keep track of allocated pages in the index tree. These fields
are normally protected by an Update latch, so that concurrent read
access to other parts of the page will be possible.

When the index root page is already exclusively latched in the
mini-transaction, we must not try to acquire a lower-grade Update latch.
In fact, when the root page is already X or U latched in the
mini-transaction, there is no point to acquire another latch.
Moreover, after a U latch was acquired on top of an X-latch,
mtr_t::defer_drop_ahi() would trigger an assertion failure or
lock corruption in block->page.lock.u_x_upgrade() because X locks
already exist on the block.

This problem may have been introduced in
commit 03ca6495df31313c96e38834b9a235245e2ae2a8 (MDEV-24142).

btr_page_alloc_low(), btr_page_free(): Initially buffer-fix the root page.
If it is already U or X latched, release the buffer-fix. Else, upgrade
the buffer-fix to a U latch.

mtr_t::u_lock_register(): Upgrade a buffer-fix to U latch.

mtr_t::have_u_or_x_latch(): Check if U or X latches are already
registered in the mini-transaction.

f02ca42... by Brad Smith

Revert aligned_alloc() addition from MDEV-28836

As pointed out with MDEV-29308 there are issues with the code as is.
MariaDB is built as C++11 / C99. aligned_alloc() is not guarenteed
to be exposed when building with any mode other than C++17 / C11.
The other *BSD's have their stdlib.h header to expose the function
with C+11 anyway, but the issue exists in the C99 code too, the
build just does not use -Werror. Linux globally defines _GNU_SOURCE
hiding the issue as well.