maria:bb-10.6-MDEV-21423

Last commit made on 2022-04-14
Get this branch:
git clone -b bb-10.6-MDEV-21423 https://git.launchpad.net/maria

Branch merges

Branch information

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

Recent commits

e5f7657... by Marko Mäkelä

MDEV-21423: Replace trx_sys.rw_trx_hash with a locked hash table

The embedded page_hash_latch in buf_pool.page_hash have served us well.
Let us attempt the same approach for trx_sys.rw_trx_hash,
instead of using the lock-free hash table that is unable to shrink.

Compared to the lock-free hash table, any iteration of the entire
hash table, as in rw_trx_hash.for_each() or rw_trx_hash.for_each_until()
may potentially modify a large number of cache lines.
Outside debug checks, trx_sys.rw_trx_hash is being iterated in
ReadView::open(), trx_sys_t::clone_oldest_view(), and
trx_sys_t::get_min_trx_id() (invoked on secondary index lock checks).

To reduce the impact of locking on processors
that support transactional memory, we introduce the predicate
rw_trx_hash_t::empty() so that unnecessary acquisition and releasing
of hash array latches can be avoided when an entire slice of the
hash array is empty.

FIXME: This is reducing throughput in many cases. How to improve this
further?

TODO: Find a reasonable value for the constexpr size_t n_cells.

2aed566... by Marko Mäkelä

Cleanup: alignas(CPU_LEVEL1_DCACHE_LINESIZE)

Let us replace all use of MY_ALIGNED in InnoDB with C++11 alignas.

CACHE_LINE_SIZE: Replaced with CPU_LEVEL1_DCACHE_LINESIZE.

03f9bb8... by Marko Mäkelä

MDEV-28313: Shrink ReadView::m_mutex

A few PERFORMANCE_SCHEMA instrumentation keys were not exposed
in all_innodb_mutexes[]. Let us remove them.

The keys fts_pll_tokenize_mutex_key and read_view_mutex_key were
internally used. Let us make ReadView::m_mutex use the simpler
and smaller srw_mutex, hoping to improve memory access patterns.

8074ab5... by Marko Mäkelä

MDEV-28313: Shrink rw_trx_hash_element_t::mutex

The element mutex is unnecessarily large. The PERFORMANCE_SCHEMA
instrumentation was not even enabled.

0cd2e6c... by Marko Mäkelä

MDEV-28313: InnoDB transactions are not aligned at cache lines

trx_lock_t: Remove byte pad[256] and use
alignas(CPU_LEVEL1_DCACHE_LINESIZE) instead.

trx_t: Declare n_ref (the first member) aligned at cache line.

Pool: Assert that the sizes are multiples of
CPU_LEVEL1_DCACHE_LINESIZE, and invoke an aligned allocator.

f7f0bc7... by Sergei Golubchik

cleanup: un-inline dtype_get_mblen()

per Marko request

fc83964... by Sergei Golubchik

MDEV-27767 poor scaling with InnoDB and utf8mb3 because of charset stats

Access the all_charsets[] array directly in a hot loop.
This avoids get_charset() that increments a shared counter via
my_collation_statistics_inc_use_count(), causing a scalability issue.

Instead, call get_charset() when a table is opened (and InnoDB
fills in dtype_t values) - this is enough, as charset is marked
ready (MY_CS_READY) only once, on the first get_charset() call,
after that it can be accessed directly.

This also fixes a potential bug in InnoDB. It used to access charsets
directly when filling dtype_t values. This wasn't preceded by any
get_charset() call inside InnoDB. Normally the server would call
get_charset() on reading the frm, but if the table was first opened
from a purge thread InnoDB could, theoretically, access a not-ready
charset in innobase_get_cset_width().

5615a78... by Oleksandr "Sanja" Byelkin

MDEV-28266 Crash in Field_string::type_handler when calling procedures

on_table_fill_finished() should always be done at the end of open()
even if result is not Select_materialize but (for example)
Select_fetch_into_spvars.

cdc0bbd... by Marko Mäkelä

Merge 10.5 into 10.6

e41500e... by Alexander Barkov

MDEV-26128 type_set and type_enum are broken

The problem was not with the server behavior,
it was with wrong test results recorded.

Enabling both type_set and type_enum.

type_set.result was OK. The test did not fail.

type_enum.result was incorrectly recorded in this commit:
  eb483c5181ab430877c135c16224284cfc517b3d

Recording correct results.