maria:bb-10.2-MDEV-23101

Last commit made on 2020-09-10
Get this branch:
git clone -b bb-10.2-MDEV-23101 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.2-MDEV-23101
Repository:
lp:maria

Recent commits

51475c6... by Jan Lindström

MDEV-23101 : SIGSEGV in lock_rec_unlock() when Galera is enabled

Remove incorrect BF (brute force) handling from lock_rec_has_to_wait_in_queue
and move condition to correct callers. Add a function to report
BF lock waits and assert if incorrect BF-BF lock wait happens.

wsrep_report_bf_lock_wait
 Add a new function to report BF lock wait.

wsrep_assert_no_bf_bf_wait
 Add a new function to check do we have a
 BF-BF wait and if we have report this case
 and assert as it is a bug.

lock_rec_has_to_wait
 Use new wsrep_assert_bf_wait to check BF-BF wait.

lock_rec_create_low
lock_table_create
 Use new function to report BF lock waits.

lock_rec_insert_by_trx_age
lock_grant_and_move_on_page
lock_grant_and_move_on_rec
 Assert that trx is not Galera as VATS is not compatible
 with Galera.

lock_rec_add_to_queue
 If there is conflicting lock in a queue make sure that
 transaction is BF.

lock_rec_has_to_wait_in_queue
 Remove incorrect BF handling. If there is conflicting
 locks in a queue all transactions must wait.

lock_rec_dequeue_from_page
lock_rec_unlock
 If there is conflicting lock make sure it is not
 BF-BF case.

lock_rec_queue_validate
 Add Galera record locking rules comment and use
 new function to report BF lock waits.

All attempts to reproduce the original assertion have been
failed. Therefore, there is no test case on this commit.

5c07ce4... by Jan Lindström

MDEV-23706 : Galera test failure on galera_autoinc_sst_mariabackup

Remove infinite procedure and use direct INSERTs.

0eb3824... by Marko Mäkelä

MDEV-23456 fixup: Simplify a comparison

040ae4c... by Marko Mäkelä

MDEV-22924 fixup: Replace C++11 auto

d44c0f4... by Marko Mäkelä

MDEV-22924 fixup: Replace C++11 nullptr

Only starting with MariaDB Server 10.4 we may depend on C++11.

64c8fa5... by Marko Mäkelä

MDEV-23685 SIGSEGV on ADD FOREIGN KEY after failed ADD KEY

dict_foreign_qualify_index(): Reject corrupted or garbage indexes.
For index stubs that are created on virtual columns, no
dict_field_t::col would be assign. Instead, the entire table
definition would be reloaded on a successful operation.

c26eae0... by Marko Mäkelä

MDEV-23456 fixup: Fix mtr_t::get_fix_count()

Before commit 05fa4558e0e82302ece981deabce764491464eb2 (MDEV-22110)
we have slot->type == MTR_MEMO_MODIFY that are unrelated to
incrementing the buffer-fix count.

FindBlock::operator(): In debug builds, skip MTR_MEMO_MODIFY entries.

Also, simplify the code a little.

This fixes an infinite loop in the tests
innodb.innodb_defragment and innodb.innodb_wl6326_big.

b1009ae... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-23456 fil_space_crypt_t::write_page0() is accessing an uninitialized page

buf_page_create() is invoked when page is initialized. So that
previous contents of the page ignored. In few cases, it calls
buf_page_get_gen() is called to fetch the page from buffer pool.
It should take x-latch on the page. If other thread uses the block
or block io state is different from BUF_IO_NONE then release the
mutex and check the state and buffer fix count again. For compressed
page, use the existing free block from LRU list to create new page.
Retry to fetch the compressed page if it is in flush list

fseg_create(), fseg_create_general(): Introduce block as a parameter
where segment header is placed. It is used to avoid repetitive
x-latch on the same page

Change the assert to check whether the page has SX latch and
X latch in all callee function of buf_page_create()

mtr_t::get_fix_count(): Get the buffer fix count of the given
block added by the mtr

FindBlock is added to find the buffer fix count of the given
block acquired by the mini-transaction

f99cace... by Marko Mäkelä

MDEV-22924 Corruption in MVCC read via secondary index

An unsafe optimization was introduced by
commit 2347ffd843b8e4ee9d8eaafab05368435db59ece (MDEV-20301)
which is based on
mysql/mysql-server@3f3136188f1bd383f77f97823cf6ebd72d5e4d7e or
mysql/mysql-server@647a3814a91c3d3bffc70ddff5513398e3f37bd4
in MySQL 8.0.12 or MySQL 8.0.13
(which in turn is based on the contribution in MySQL Bug #84958).

Row_sel_get_clust_rec_for_mysql::operator(): In addition to checking
that the pointer to the record matches, also check the latest
modification of the page (FIL_PAGE_LSN) as well as the page identifier.
Only if all three match, it is safe to reuse cached_old_vers.

Row_sel_get_clust_rec_for_mysql::check_eq(): Assert that the PRIMARY KEY
of the cached old version of the record corresponds to the latest version.

We got a test case where CHECK TABLE, UPDATE and purge would be
hammering on the same table (with only 6 rows) and a pointer that
was originally pointing to a record pk=2 would match a cached_clust_rec
that was pointing to a record pk=1. In the diagnosed `rr replay` trace,
we would wrongly return an old cached version of the pk=1 record,
instead of retrieving the correct version of the pk=2 record. Because
of this, CHECK TABLE would fail to count one of the records in a
secondary index, and report failure.

This bug appears to affect MVCC reads via secondary indexes only.
The purge of history in secondary indexes uses a different code path,
and so do checks for implicit record locks.

9dedba1... by Kentoku SHIBA

MDEV-7098 spider/bg.spider_fixes failed in buildbot with safe_mutex: Trying to unlock mutex conn->mta_conn_mutex that wasn't locked at storage/spider/spd_db_conn.cc, line 671