maria:bb-10.4-MDEV-31004

Last commit made on 2023-08-14
Get this branch:
git clone -b bb-10.4-MDEV-31004 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.4-MDEV-31004
Repository:
lp:maria

Recent commits

efe189f... by Lena Startseva <email address hidden>

MDEV-31004: Create cte-protocol

Added new protocol for MTR tests: cte-protocol. This protocol
converts all queries started with "SELECT" into non-recursive
common table expression (CTE). Also added possibility to enable/
disable cte-protocol ("--disable_cte_protocol/--enable_cte_protocol")

b2e312b... by Kristian Nielsen

MDEV-23021: rpl.rpl_parallel_optimistic_until fails in Buildbot

The test case accessed slave-relay-bin.000003 without waiting for the IO
thread to write it first. If the IO thread was slow, this could fail.

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

5055490... by Kristian Nielsen

MDEV-381: fdatasync() does not correctly flush growing binlog file

Revert the old work-around for buggy fdatasync() on Linux ext3. This bug was
fixed in Linux > 10 years ago back to kernel version at least 3.0.

Reviewed-by: Marko Mäkelä <email address hidden>
Signed-off-by: Kristian Nielsen <email address hidden>

e9333ff... by Monty <email address hidden>

MDEV-31893 Valgrind reports issues in main.join_cache_notasan

This is also related to
MDEV-31348 Assertion `last_key_entry >= end_pos' failed in virtual bool
           JOIN_CACHE_HASHED::put_record()

Valgrind exposed a problem with the join_cache for hash joins:
=25636== Conditional jump or move depends on uninitialised value(s)
==25636== at 0xA8FF4E: JOIN_CACHE_HASHED::init_hash_table()
          (sql_join_cache.cc:2901)

The reason for this was that avg_record_length contained a random value
if one had used SET optimizer_switch='optimize_join_buffer_size=off'.

This causes either 'random size' memory to be allocated (up to
join_buffer_size) which can increase memory usage or, if avg_record_length
is less than the row size, memory overwrites in thd->mem_root, which is
bad.

Fixed by setting avg_record_length in JOIN_CACHE_HASHED::init()
before it's used.

There is no test case for MDEV-31893 as valgrind of join_cache_notasan
checks that.
I added a test case for MDEV-31348.

161ce04... by Andrew Hutchings

Revert "use environment file in systemd units for _WSREP_START_POSITION"

This reverts commit 6c40590405da71a592a65b68e6b41b11437fb517.

48e6918... by Andrew Hutchings

Revert "update galera_new_cluster to use environment file"

This reverts commit b54e4bf00b191633c74baad143c552bfb478fff3.

277968a... by =?utf-8?q?Jan_Lindstr=C3=B6m?= <email address hidden>

MDEV-31413 : Node has been dropped from the cluster on Startup / Shutdown with async replica

There was two related problems:

(1) Galera node that is defined as a slave to async MariaDB
master at restart might do SST (state stransfer) and
part of that it will copy mysql.gtid_slave_pos table.
Problem is that updates on that table are not replicated
on a cluster. Therefore, table from donor that is not
slave is copied and joiner looses gtid position it was
and start executing events from wrong position of the binlog.
This incorrect position could break replication and
causes node to be dropped and requiring user action.

(2) Slave sql thread might start executing events before
galera is ready (wsrep_ready=ON) and that could also
cause node to be dropped from the cluster.

In this fix we enable replication of mysql.gtid_slave_pos
table on a cluster. In this way all nodes in a cluster
will know gtid slave position and even after SST joiner
knows correct gtid position to start.

Furthermore, we wait galera to be ready before slave
sql thread executes any events to prevent too early
execution.

Signed-off-by: Julius Goryavsky <email address hidden>

b54e4bf... by Christian Hesse

update galera_new_cluster to use environment file

Now that the systemd unit files use an environment file to pass
_WSREP_START_POSITION we have to update galera_new_cluster as well.

6c40590... by Christian Hesse

use environment file in systemd units for _WSREP_START_POSITION

We used to run `systemctl set-environment` to pass
_WSREP_START_POSITION. This is bad because:

* it clutter systemd's environment (yes, pid 1)
* it requires root privileges
* options (like LimitNOFILE=) are not applied

Let's just create an environment file in ExecStartPre=, that is read
before ExecStart= kicks in. We have _WSREP_START_POSITION around for the
main process without any downsides.

ab10a67... by Sergei Golubchik

MDEV-31092 mysqldump --force doesn't ignore error as it should

failed SHOW CREATE FUNCTION means we don't dump this function,
but should still try to dump all other functions