maria:bb-10.6-MDEV-27317-galera

Last commit made on 2023-02-20
Get this branch:
git clone -b bb-10.6-MDEV-27317-galera https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.6-MDEV-27317-galera
Repository:
lp:maria

Recent commits

faa91e5... by Teemu Ollakka <email address hidden>

MDEV-27317 wsrep_checkpoint order violation due to certification failure

With binlogs enabled, debug assertion ut_ad(xid_seqno > wsrep_seqno)
fired in trx_rseg_update_wsrep_checkpoint() when an applier thread
synced the seqno out of order for write set which had failed
certification. This was caused by releasing commit
order too early when binlogs were on, allowing group
commit to run in parallel and commit following transactions
too early.

Fixed by extending the commit order critical section to cover
call to wsrep_set_SE_checkpoint() also when binlogs are on.

Signed-off-by: Julius Goryavsky <email address hidden>

67a6ad0... by Marko Mäkelä

Merge 10.5 into 10.6

d3f35aa... by Marko Mäkelä

MDEV-30552 fixup: Fix the test for non-debug

0c79ae9... by Marko Mäkelä

Fix clang -Winconsistent-missing-override

201cfc3... by Marko Mäkelä

MDEV-30638 Deadlock between INSERT and InnoDB non-persistent statistics update

This is a partial revert of
commit 8b6a308e463f937eb8d2498b04967a222c83af90 (MDEV-29883)
and a follow-up to the
merge commit 394fc71f4fa8f8b1b6d24adfead0ec45121d271e (MDEV-24569).

The latching order related to any operation that accesses the allocation
metadata of an InnoDB index tree is as follows:

1. Acquire dict_index_t::lock in non-shared mode.
2. Acquire the index root page latch in non-shared mode.
3. Possibly acquire further index page latches. Unless an exclusive
dict_index_t::lock is held, this must follow the root-to-leaf,
left-to-right order.
4. Acquire a *non-shared* fil_space_t::latch.
5. Acquire latches on the allocation metadata pages.
6. Possibly allocate and write some pages, or free some pages.

btr_get_size_and_reserved(), dict_stats_update_transient_for_index(),
dict_stats_analyze_index(): Acquire an exclusive fil_space_t::latch
in order to avoid a deadlock in fseg_n_reserved_pages() in case of
concurrent access to multiple indexes sharing the same "inode page".

fseg_page_is_allocated(): Acquire an exclusive fil_space_t::latch
in order to avoid deadlocks. All callers are holding latches
on a buffer pool page, or an index, or both.
Before commit edbde4a11fd0b6437202f8019a79911441b6fb32 (MDEV-24167)
a third mode was available that would not conflict with the shared
fil_space_t::latch acquired by ha_innobase::info_low(),
i_s_sys_tablespaces_fill_table(),
or i_s_tablespaces_encryption_fill_table().
Because those calls should be rather rare, it makes sense to use
the simple rw_lock with only shared and exclusive modes.

fil_crypt_get_page_throttle(): Avoid invoking fseg_page_is_allocated()
on an allocation bitmap page (which can never be freed), to avoid
acquiring a shared latch on top of an exclusive one.

mtr_t::s_lock_space(), MTR_MEMO_SPACE_S_LOCK: Remove.

54c0ac7... by Marko Mäkelä

MDEV-30134 Assertion failed in buf_page_t::unfix() in buf_pool_t::watch_unset()

buf_pool_t::watch_set(): Always buffer-fix a block if one was found,
no matter if it is a watch sentinel or a buffer page. The type of
the block descriptor will be rechecked in buf_page_t::watch_unset().
Do not expect the caller to acquire the page hash latch. Starting with
commit bd5a6403cace36c6ed428cde62e35adcd3f7e7d0 it is safe to release
buf_pool.mutex before acquiring a buf_pool.page_hash latch.

buf_page_get_low(): Adjust to the changed buf_pool_t::watch_set().

This simplifies the logic and fixes a bug that was reproduced when
using debug builds and the setting innodb_change_buffering_debug=1.

9c15799... by Marko Mäkelä

MDEV-30397: MariaDB crash due to DB_FAIL reported for a corrupted page

buf_read_page_low(): Map the buf_page_t::read_complete() return
value DB_FAIL to DB_PAGE_CORRUPTED. The purpose of the DB_FAIL
return value is to avoid error log noise when read-ahead brings
in an unused page that is typically filled with NUL bytes.

If a synchronous read is bringing in a corrupted page where the
page frame does not contain the expected tablespace identifier and
page number, that must be treated as an attempt to read a corrupted
page. The correct error code for this is DB_PAGE_CORRUPTED.
The error code DB_FAIL is not handled by row_mysql_handle_errors().

This was missed in commit 0b47c126e31cddda1e94588799599e138400bcf8
(MDEV-13542).

cc27e5f... by Marko Mäkelä

Merge 10.5 into 10.6

5300c0f... by Marko Mäkelä

MDEV-30657 InnoDB: Not applying UNDO_APPEND due to corruption

This almost completely reverts
commit acd23da4c2363511aae7d984c24cc6847aa3f19c and
retains a safe optimization:

recv_sys_t::parse(): Remove any old redo log records for the
truncated tablespace, to free up memory earlier.
If recovery consists of multiple batches, then recv_sys_t::apply()
will must invoke recv_sys_t::trim() again to avoid wrongly
applying old log records to an already truncated undo tablespace.

4afa3b6... by Vicențiu Ciorbaru

MDEV-30324: Wrong result upon SELECT DISTINCT ... WITH TIES

WITH TIES would not take effect if SELECT DISTINCT was used in a
context where an INDEX is used to resolve the ORDER BY clause.

WITH TIES relies on the `JOIN::order` to contain the non-constant
fields to test the equality of ORDER BY fiels required for WITH TIES.

The cause of the problem was a premature removal of the `JOIN::order`
member during a DISTINCT optimization. This lead to WITH TIES code assuming
ORDER BY only contained "constant" elements.

Disable this optimization when WITH TIES is in effect.

(side-note: the order by removal does not impact any current tests, thus
it will be removed in a future version)

Reviewed by: <email address hidden>