maria:bb-10.6-wlad-tpool

Last commit made on 2023-04-25
Get this branch:
git clone -b bb-10.6-wlad-tpool https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.6-wlad-tpool
Repository:
lp:maria

Recent commits

2403eed... by Vladislav Vaintroub

MDEV-31095 tpool - do not create new worker, if thread creation is pending.

Use an std::atomic_flag to track thread creation in progress.
This is mainly a cleanup, the effect of this change was not measureable
in my tests.

3eaab28... by Vladislav Vaintroub

MDEV-31095 tpool - restrict threadpool concurrency during bufferpool load

Add threadpool functionality to restrict concurrency during "batch"
periods (where tasks are added in rapid succession).
This will throttle thread creation more agressively than usual, while
keeping performance at least on-par.

One of these cases is bufferpool load, where async read IOs are executed
without any throttling. There can be as much as 650K read IOs for
loading 10GB buffer pool.

Why there are more threads than we expect?
Worker threads are not be recognized as idle, until they return to the
standby list, and to return to that list, they need to acquire
mutex currently held in the submit_task(). In those cases, submit_task()
has no worker to wake, and would create threads until default concurrency
level (2*ncpus) is satisfied. Only after that throttling would happen.

Normally, this is fine, and the extraneous threads would go away when they
are idle for 60sec, yet for specific cases such as DB startup we can lower
concurrency level, if this makes someone happier.

f56bbdb... by Vladislav Vaintroub

MDEV-31095 tpool - reduce wakeups and thread creations from submit_task

In case of task belonging to a task_group, submit_task() would do more
work than necessary, when the maximum concurrency of the group is reached.

Instead of adding task to common queue, waking or creating a thread,
often it can be added to group's local queue.

This patch adds task_group::try_add_task() and tpool::submit_group_task()
which implement this optimization.

For now, it will be used for the IO handling.

818d5e4... by Marko Mäkelä

Merge 10.5 into 10.6

50f3b7d... by Marko Mäkelä

MDEV-31124 Innodb_data_written miscounts doublewrites

When commit a5a2ef079cec378340d8b575aef05974b0b3442e
implemented asynchronous doublewrite, the writes via
the doublewrite buffer started to be counted incorrectly,
without multiplying them by innodb_page_size.

srv_export_innodb_status(): Correctly count the
Innodb_data_written.

buf_dblwr_t: Remove submitted(), because it is close to written()
and only Innodb_data_written was interested in it. According to
its name, it should count completed and not submitted writes.

Tested by: Axel Schwenke

31f09e3... by Brandon Nesterenko

MDEV-31038: Parallel Replication Breaks if XA PREPARE Fails Updating Slave GTID State

If a replica failed to update the GTID slave state when committing
an XA PREPARE, the replica would retry the transaction and get an
out-of-order GTID error. This is because the commit phase of an XA
PREPARE is bifurcated. That is, first, the prepare is handled by the
relevant storage engines. Then second, the GTID slave state is
updated as a separate autocommit transaction. If the second phase
fails, and the transaction is retried, then the same transaction is
attempted to be committed again, resulting in a GTID out-of-order
error.

This patch fixes this error by immediately stopping the slave and
reporting the appropriate error. That is, there was logic to bypass
the error when updating the GTID slave state table if the underlying
error is allowed for retry on a parallel slave. This patch adds a
parameter to disallow the error bypass, thereby forcing the error
state to still happen.

Reviewed By
============
Andrei Elkin <email address hidden>

1d74927... by Oleksandr "Sanja" Byelkin

Merge branch '10.4' into 10.5

0976afe... by Marko Mäkelä

MDEV-31114 Assertion !...is_waiting() failed in os_aio_wait_until_no_pending_writes()

os_aio_wait_until_no_pending_reads(), os_aio_wait_until_pending_writes():
Add a Boolean parameter to indicate whether the wait should be declared
in the thread pool.

buf_flush_wait(): The callers have already declared a wait, so let us
avoid doing that again, just call os_aio_wait_until_pending_writes(false).

buf_flush_wait_flushed(): Do not declare a wait in the rare case that
the buf_flush_page_cleaner thread has been shut down already.

buf_flush_page_cleaner(), buf_flush_buffer_pool(): In the code that runs
during shutdown, do not declare waits.

buf_flush_buffer_pool(): Remove a debug assertion that might fail.
What really matters here is buf_pool.flush_list.count==0.

buf_read_recv_pages(), srv_prepare_to_delete_redo_log_file():
Do not declare waits during InnoDB startup.

d3e394b... by Alexander Barkov

A cleanup for MDEV-30968 mariadb-backup does not copy Aria logs if aria_log_dir_path is used

Fixing buildbot failures on mariabackup.aria_log_dir_path_rel.

The problem was that directory_exists() was called with the
relative aria_log_dir_path value, while the current directory
in mariadb-backup is not necessarily equal to datadir when MTR is running.

Fix:

- Moving building the absolute path un level upper:
  from the function copy_back_aria_logs() to the function copy_back().
- Passing the built absolute path to both directory_exists() and
  copy_back_aria_logs() as a parameter.

2c567b2... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-30996 insert.. select in presence of full text index freezes all other commits at commit time

- This patch does the following:
git revert --no-commit 673243c8938957ef1c01ffd3bfd35b5ae31ef484
git revert --no-commit 6c669b9586f72d6d760cc3956c1a0cb09ace2367
git revert --no-commit bacaf2d4f4c6d77a0b6c1ae4daddd19f81ef6fa3
git checkout HEAD mysql-test
git revert --no-commit 1fd7d3a9adac50de37e40e92188077e3515de505

Above command reverts MDEV-29277, MDEV-25581, MDEV-29342.

When binlog is enabled, trasaction takes a lot of time to do
sync operation on innodb fts table. This leads to block
of other transaction commit. To avoid this failure, remove
the fulltext sync operation during transaction commit. So
reverted MDEV-25581 related patches.

We filed MDEV-31105 to avoid the memory consumption
problem during fulltext sync operation.