maria:11.4-MDEV-7850-keep-tid

Last commit made on 2024-01-31
Get this branch:
git clone -b 11.4-MDEV-7850-keep-tid https://git.launchpad.net/maria

Branch merges

Branch information

Name:
11.4-MDEV-7850-keep-tid
Repository:
lp:maria

Recent commits

5de3ff5... by Brandon Nesterenko

MDEV-7850: Fix galera_sr.MDEV-18585

Binlog position changed due to presence of GTID thread_id

cd626ea... by Brandon Nesterenko

MDEV-7850: Add break and cleanup

b13ce59... by Brandon Nesterenko

MDEV-7850: GTID Thread_id Post-Push Fixes

Note this is currently a work-in-progress, pushed for
potential early feedback.

It addresses:
 1) The original thread_id of the master is propagated into
    the thread_id of the slave-binlogged GTID thread_id,
    rather than the thread_id of the applier thread.
 2) When seeing Q_DUMMY, rather than loop through each
    status var byte, skip to the end of the status var
    section.
 3) Added comments to explain the purpose of Q_DUMMY
 4) Simplified Query_log_event::begin_event to always use
    Q_DUMMY, rather than keeping the time zone str as well
 5) Fixed DBUG_ASSERT to be part of the conditoin to read in
    the event thread id, as to not read unowned memory
 6) Removed invalid ASSERTIONS for begin_event()

b0e77c0... by VladislavVaintroub

MDEV-32216 Option --parallel in mariadb-import

This is done for symmetry with mariadb-dump, which does not use threads
but allows parallelism via --parallel

Traditional --use-threads can still be used, it is synonymous
with --parallel

a5802ed... by VladislavVaintroub

MDEV-32216 add tests for mariadb-dump --parallel

- --parallel=N with or without --single-transaction
- Error cases (too many connections, emulate error on one connection)
- Windows specific test for named pipe connections

4532dae... by VladislavVaintroub

MDEV-32216 option --parallel/-j for mariadb-dump to increase parallelism

At the moment, it only works with --tab, to execute "SELECT INTO OUTFILE"
queries concurrently.

Uses connection_pool for concurrent execution.

ec5db64... by VladislavVaintroub

MDEV-32216 Connection pool with asynchronous query execution.

Parallelism is achieved by using mysql_send_query on multiple connections
without waiting for results, and using IO multiplexing (poll/IOCP) to
wait for completions.

Refresh libmariadb to pick up CONC-676 (fixes for IOCP use with named pipe)

9766a83... by VladislavVaintroub

MDEV-32216 preparation - cleanup mysqldump.cc code

- make connect_to_db() return MYSQL*, we'll reuse the function for
  connection pool.

- Remove variable 'mysql_connection', duplicated by variable 'mysql'
- do not attempt to start slave if connection did not succeed,#
  and fix mysqldump.result

a553d55... by VladislavVaintroub

MDEV-32216 Compile mysqldump as C++ (preparation for using connection pool)

d039346... by Kristian Nielsen

MDEV-4991: GTID binlog indexing

Improve the performance of slave connect using B+-Tree indexes on each binlog
file. The index allows fast lookup of a GTID position to the corresponding
offset in the binlog file, as well as lookup of a position to find the
corresponding GTID position.

This eliminates a costly sequential scan of the starting binlog file
to find the GTID starting position when a slave connects. This is
especially costly if the binlog file is not cached in memory (IO
cost), or if it is encrypted or a lot of slaves connect simultaneously
(CPU cost).

The size of the index files is generally less than 1% of the binlog data, so
not expected to be an issue.

Most of the work writing the index is done as a background task, in
the binlog background thread. This minimises the performance impact on
transaction commit. A simple global mutex is used to protect index
reads and (background) index writes; this is fine as slave connect is
a relatively infrequent operation.

Here are the user-visible options and status variables. The feature is on by
default and is expected to need no tuning or configuration for most users.

binlog_gtid_index
  On by default. Can be used to disable the indexes for testing purposes.

binlog_gtid_index_page_size (default 4096)
  Page size to use for the binlog GTID index. This is the size of the nodes
  in the B+-tree used internally in the index. A very small page-size (64 is
  the minimum) will be less efficient, but can be used to stress the
  BTree-code during testing.

binlog_gtid_index_span_min (default 65536)
  Control sparseness of the binlog GTID index. If set to N, at most one
  index record will be added for every N bytes of binlog file written.
  This can be used to reduce the number of records in the index, at
  the cost only of having to scan a few more events in the binlog file
  before finding the target position

Two status variables are available to monitor the use of the GTID indexes:

  Binlog_gtid_index_hit
  Binlog_gtid_index_miss

The "hit" status increments for each successful lookup in a GTID index.
The "miss" increments when a lookup is not possible. This indicates that the
index file is missing (eg. binlog written by old server version
without GTID index support), or corrupt.

Signed-off-by: Kristian Nielsen <email address hidden>