maria:bb-10.6-MDEV-28709-post-push-fix

Last commit made on 2022-10-27
Get this branch:
git clone -b bb-10.6-MDEV-28709-post-push-fix https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.6-MDEV-28709-post-push-fix
Repository:
lp:maria

Recent commits

8a450a7... by Vlad Lesin

MDEV-28709 unexpected X lock on Supremum in READ COMMITTED

Post-push fix. The flag of transaction which indicates that it's necessary
to forbid gap lock inheritance after XA PREPARE could be inverted if
lock_release_on_prepare_try() is invoked several times. The fix is to
toggle it on lock_release_on_prepare() exit.

18a0f0c... by Daniel Black

Fix AIX compulation (break addr resolution)

Revert c92c1615852ecd4be2d04203600efd3eba578a02, casting to void*
cannot fool gcc. The AIX address resolution was broken anyway, so
just avoid the problem and make it compile well.

79dc398... by Marko Mäkelä

Disable perfschema.mdl_func on Windows

The test fails extremely often on a Windows builder, and nobody seems
to be interested in fixing it.

cf96db4... by Marko Mäkelä

MDEV-29886 Assertion !index->table->is_temporary() failed in CHECK TABLE

ha_innobase::check(): Do not enable READ UNCOMMITTED isolation level
for temporary tables, because it would report index count mismatch
for secondary indexes.

row_check_index(): Ignore EXTENDED for temporary tables, because
the tables are private to the current connection and there will be
no purge of committed transaction history.

8b6a308... by Marko Mäkelä

MDEV-29883 Deadlock between InnoDB statistics update and BLOB insert

The test innodb.innodb-wl5522-debug would occasionally hang
(especially when run with ./mtr --rr) due to a deadlock between
btr_store_big_rec_extern_fields() and dict_stats_analyze_index().
The two threads would acquire the clustered index root page latch and
the tablespace latch in the opposite order. The deadlock was possible
because dict_stats_analyze_index() was holding the index latch in
shared mode and an index root page latch, while waiting for the
tablespace latch. If a stronger dict_index_t::lock had been held
by dict_stats_analyze_index(), any operations that free or allocate
index pages would have been blocked.

In each caller of fseg_n_reserved_pages() except ibuf_init_at_db_start()
which is a special case for ibuf.index at database startup, we must hold
an index latch that prevents concurrent allocation or freeing of index
pages.

Any operation that allocates or free pages that belong to an index tree
must first acquire an index latch in Update or Exclusive mode, and while
holding that, acquire an index root page latch in Update or Exclusive
mode.

dict_index_t::clear(): Also acquire an index latch. Otherwise,
the test innodb.insert_into_empty could hang.

btr_get_size_and_reserved(): Assert that a strong enough index latch
is being held. Only acquire a shared fil_space_t::latch; we are only
reading, not modifying any data.

dict_stats_update_transient_for_index(),
dict_stats_analyze_index(): Acquire a strong enough index latch. Only
acquire a shared fil_space_t::latch.

These operations had followed the same order of acquiring latches in
every InnoDB version since the very beginning
(commit c533308a158795f91247e9fe3c7304fa5e7d2b3c).
The calls for acquiring tablespace latch had previously been moved in
commit 87839258f86196dfca1d3af2a947e570e13eeb94 and
commit 1e9c922fa726b22f4522f2a4de0fcb6595404086.

The hang was introduced in
commit 2e814d4702d71a04388386a9f591d14a35980bfe which imported
mysql/mysql-server@ac74632293bea967b352d1b472abedeeaa921b98
which failed to strengthen the locking requirements of the function
btr_get_size().

78a04a4... by Vlad Lesin

MDEV-29869 mtr failure: innodb.deadlock_wait_thr_race

1. The merge aeccbbd926e759a5c3b9818d9948a35918404478 has overwritten
lock0lock.cc, and the changes of MDEV-29622 and MDEV-29635 were
partially lost, this commit restores the changes.

2. innodb.deadlock_wait_thr_race test:

The following hang was found during testing.

There is deadlock_report_before_lock_releasing sync point in
Deadlock::report(), which is waiting for sel_cont signal under lock_sys_t
lock. The signal must be issued after "UPDATE t SET b = 100" rollback,
and that rollback is executing undo record, which is blocked
on dict_sys latch request. dict_sys is locked by the thread of statistics
update(dict_stats_save()), and during that update lock_sys lock is
requested, and can't be acquired as Deadlock::report() holds it. We have
to disable statistics update to make the test stable.

But even if statistics update is disabled, and transaction with consistent
snapshot is started at the very beginning of the test to prevent purging,
the purge can still be invoked for system tables, and it tries to open
system table by id, what causes dict_sys.freeze() call and dict_sys
latching. What, in combination with lock_sys::xx_lock() causes the same
deadlock as described above. We need to disable purging globally for the
test as well.

All the above is applicable to innodb.deadlock_wait_lock_race test also.

5027cb2... by Oleg Smirnov

MDEV-29662 Replace same values in 'IN' list with an equality

If all elements in the list of 'IN' or 'NOT IN' clause are equal
and there are no NULLs then clause
- "a IN (e1,..,en)" can be converted to "a = e1"
- "a NOT IN (e1,..,en)" can be converted to "a <> e1".
This means an object of Item_func_in can be replaced with an object
of Item_func_eq for IN (e1,..,en) clause and Item_func_ne for
NOT IN (e1,...,en). Such a replacement allows the optimizer to choose
a better execution plan

b7fe617... by Vladislav Vaintroub

MDEV-29843 Do not use asynchronous log_write_upto() for system THDs

Non-blocking log_write_upto (MDEV-24341) was only designed for the
client connections. Fix, so it is not be triggered for any system THD.

Previously, an incomplete solution only excluded Innodb purge THDs, but
not the slave for example.

The hang in MDEV still remains somewhat a mystery though, it is not
immediately clear how exactly condition variable can become corrupted.
But it is clear that it can be avoided.

5dd411c... by Marko Mäkelä

MDEV-29871: Temporarily disable the test

aeccbbd... by Marko Mäkelä

Merge 10.5 into 10.6

To prevent ASAN heap-use-after-poison in the MDEV-16549 part of
./mtr --repeat=6 main.derived
the initialization of Name_resolution_context was cleaned up.