maria:bb-10.6-marko

Last commit made on 2023-09-12
Get this branch:
git clone -b bb-10.6-marko https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.6-marko
Repository:
lp:maria

Recent commits

31931b6... by Marko Mäkelä

MDEV-32068 Some calls to buf_read_ahead_linear() seem to be useless

The linear read-ahead (enabled by nonzero innodb_read_ahead_threshold)
works best if index leaf pages or undo log pages have been allocated
on adjacent page numbers. The read-ahead is assumed not to be helpful
in other types of page accesses, such as non-leaf index pages.

buf_page_get_low(): Do not invoke buf_page_t::set_accessed(),
buf_page_make_young_if_needed(), or buf_read_ahead_linear().
We will invoke them in those callers of buf_page_get_gen() or
buf_page_get() where it makes sense: the access is not
one-time-on-startup and the page and not going to be freed soon.

btr_copy_blob_prefix(), btr_pcur_move_to_next_page(),
trx_undo_get_prev_rec_from_prev_page(),
trx_undo_get_first_rec(), btr_cur_t::search_leaf(),
btr_cur_t::open_leaf(): Invoke buf_read_ahead_linear().

We will not invoke linear read-ahead in functions that would
essentially allocate or free pages, because allocated pages
should be reinitialized by buf_page_create(), eliminating the
need to read anything from the file system. Likewise, freeing
pages should not involve accessing any sibling pages, except
for freeing singly-linked lists of BLOB pages.

We will not invoke read-ahead in btr_cur_t::pessimistic_search_leaf()
or in a pessimistic operation of btr_cur_t::open_leaf(), because
it is assumed that pessimistic operations should be preceded by
optimistic operations, which should already have invoked read-ahead.

736901b... by Marko Mäkelä

MDEV-30100 fixup: Remove a failing debug assertion

trx_purge_truncate_history(): Remove a debug assertion that
had originally been added in
commit 0de3be8cfdfc26f5c236eaefe12d03c7b4af22c8 (MDEV-30671).
In trx_t::commit_empty() we do not have any efficient way to rewind
rseg.needs_purge to an accurate value that would satisfy this
debug assertion.

Note: No correctness property should be violated here. At the point
where the debug assertion was located, we had already established
that purge_sys.sees(rseg.needs_purge) holds, that is, it is safe
to remove everything from rseg.

3c840ae... by Marko Mäkelä

MDEV-26782 fixup: Remove dead code

trx_undo_reuse_cached(): Assert that this is being invoked on the
persistent rollback segment of the transaction, and remove dead code
that was handling cached temporary undo log. This was missed in
commit 51e62cb3b3b5f28a67c3c5862b3cb60ecf87180a (MDEV-26782).

a03b8cd... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-32145 Disable read-ahead for temporary tablespace

- Lifetime of temporary tables is expected to be short, it would
seem to make sense to assume that all temporary tablespace pages
will remain in the buffer pool. It doesn't make sense to have
read-ahead for pages of temporary tablespace

cdd2fa7... by Marko Mäkelä

MDEV-32134 InnoDB hang in buf_flush_wait_LRU_batch_end()

buf_flush_page_cleaner(): Before finishing a batch, wake up any threads
that are waiting for buf_pool.done_flush_LRU.

This should fix a hung shutdown that we observed
after SET GLOBAL innodb_buffer_pool_size started was executed
to shrink the InnoDB buffer pool.

466d9f5... by Marko Mäkelä

MDEV-32103 InnoDB ALTER TABLE is not crash-safe

Starting with commit 4ff5311decd8c239bc5c2b8aabd0f44004aa2fdd
log_write_up_to(trx->commit_lsn, true) in DDL operations could end up
being a no-op, because trx->commit_lsn would be 0.

trx_flush_log_if_needed(): Revert an incorrect attempt to ensure
that DDL operations are crash-safe.

trx_t::commit(std::vector<pfs_os_file_t> &), ha_innobase::rename_table():
Set trx_t::flush_log_later so that trx_t::commit_in_memory() will
retain trx_t::commit_lsn for the final durability call.

Tested by: Matthias Leich

4a8291f... by Marko Mäkelä

MDEV-30531 Corrupt index(es) on busy table when using FOREIGN KEY

lock_wait(): Never return the transient error code DB_LOCK_WAIT.
In commit 78a04a4c22d54dc4f67f067fc9b7a0bc717ebfdd (MDEV-29869)
some assignments assign trx->error_state = DB_SUCCESS were removed,
and it was possible that the field was left at its initial value
DB_LOCK_WAIT.

The test case for this is nondeterministic; without this fix, it
would only occasionally fail.

Reviewed by: Vladislav Lesin

e039720... by Marko Mäkelä

MDEV-32096 Parallel replication lags because innobase_kill_query() may fail to interrupt a lock wait

lock_sys_t::cancel(trx_t*): Remove, and merge to its only caller
innobase_kill_query().

innobase_kill_query(): Before reading trx->lock.wait_lock,
do acquire lock_sys.wait_mutex, like we did before
commit e71e6133535da8d5eab86e504f0b116a03680780 (MDEV-24671).
In this way, we should not miss a recently started lock wait
by the killee transaction.

lock_rec_lock(): Add a DEBUG_SYNC "lock_rec" for the test case.

lock_wait(): Invoke trx_is_interrupted() before entering the wait,
in case innobase_kill_query() was invoked some time earlier and
some longer-running operation did not check for interrupts.
As suggested by Vladislav Lesin, do not overwrite
trx->error_state==DB_INTERRUPTED with DB_SUCCESS.
This would avoid a call to trx_is_interrupted() when the test is
modified to use the DEBUG_SYNC point lock_wait_start instead of lock_rec.
Avoid some redundant loads of trx->lock.wait_lock; cache the value
in the local variable wait_lock.

Deadlock::check_and_resolve(): Take wait_lock as a parameter and
return wait_lock (or -1 or nullptr). We only need to reload
trx->lock.wait_lock if lock_sys.wait_mutex had been released
and reacquired.

trx_t::error_state: Correctly document the data member.

trx_lock_t::was_chosen_as_deadlock_victim: Clarify that other threads
may set the field (or flags in it) while holding lock_sys.wait_mutex.

Thanks to Johannes Baumgarten for reporting the problem and testing
the fix, as well as to Kristian Nielsen for suggesting the fix.

Reviewed by: Vladislav Lesin
Tested by: Matthias Leich

0dd25f2... by Marko Mäkelä

Merge 10.5 into 10.6

ef569c3... by Marko Mäkelä

MDEV-21679 fixup for s390x

Some s390x environments include
https://github.com/madler/zlib/pull/410
and a more pessimistic compressBound: (sourceLen * 16 + 2308) / 8 + 6.
Let us adjust the recently enabled tests accordingly.