1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-11 05:52:26 +03:00
Commit Graph

1766 Commits

Author SHA1 Message Date
Kristian Nielsen
694715123e MDEV-34705: Binlog-in-engine: Protect against concurrent RESET MASTER and dump threads
This is actually an existing problem in the old binlog implementation, and
this patch is applicable to old binlog also. The problem is that RESET
MASTER can run concurrently with binlog dump threads / connected slaves.
This will remove the binlog from under the feet of the reader, which can
cause all sorts of strange behaviour.

This patch fixes the problem by disallowing to run RESET MASTER when dump
threads (or other RESET MASTER or SHOW BINARY LOGS) are running. An error is
thrown in this case, user must stop slaves and/or kill dump threads to make
the RESET MASTER go through. A slave that connects in the middle of RESET
MASTER will wait for it to complete.

Fix a lot of test cases to kill any lingering dump threads before doing
RESET MASTER, mostly just by sourcing include/kill_binlog_dump_threads.inc.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2025-09-03 18:28:22 +02:00
Marko Mäkelä
257f4b30ef Merge 10.11 into 11.4 2025-09-03 10:32:56 +03:00
Julius Goryavsky
aa3dd63d40 Merge branch '10.6' into '10.11' 2025-08-14 22:10:45 +02:00
Julius Goryavsky
525ae97b12 galera tests: synchronization between versions and editions 2025-08-14 17:04:40 +02:00
Jan Lindström
3d11313b6f MDEV-36134 : Mariadb server crashed during insert
Replication filtering is not safe for cluster consistency.
There is problem when two or more filtering rules are
provided by user. Here, we disable replication filtering
inside a Galera cluster for now. To support safe replication
filereing in the Galera cluster it should also effect SST/IST.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-08-14 16:47:16 +02:00
Denis Protivensky
6dfc9bc75b MDEV-36710: Revert "MDEV-33136: backport corrections from 10.11+"
This reverts commit 0403f0147f
for 10.6 branch. It caused MDEV-33136 test to fail in 10.6 branch.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-08-14 16:41:07 +02:00
Julius Goryavsky
186b0643f4 Merge branch '10.6' into '10.11' 2025-08-14 03:15:04 +02:00
Julius Goryavsky
fc2990fd90 MDEV-37366 test correction: added missing --disable_ps_protocol 2025-08-14 03:11:08 +02:00
Hemant Dangi
88d43afd33 MDEV-37366: Inconsistency detected - create sequence
Issue:

When applying 'SELECT NEXT VALUE..' on applier node with
binlog_row_image=MINIMAL and log-binlog enabled, applier
node fails with below error:

Slave SQL: Could not execute Write_rows_v1 event on table monitor.seq_moni_num; Unknown error, Error_code: 1105; handler error No Error!; the event's master log FIRST, end_log_pos 0, Internal MariaDB error code: 1105

To reproduce run below command on the first/active node:

> CREATE SEQUENCE `seq_test` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 0 cache 1000 nocycle ENGINE=InnoDB;
> SELECT NEXT VALUE FOR seq_test;
> SELECT NEXT VALUE FOR seq_test;

The applier node will leave the cluster after executing
the 'SELECT NEXT VALUE' with below error:

ERROR] Slave SQL: Could not execute Write_rows_v1 event on table test.seq_test; Unknown error, Error_code: 1105; handler error No Error!; the event's master log FIRST, end_log_pos 0, Internal MariaDB error code: 1105
[Warning] WSREP: Event 3 Write_rows_v1 apply failed: 195, seqno 14511334511

Solution:

When binary loggging is enabled and binlog_row_image is set to
'MINIMAL', then 'SELECT NEXT VALUE' fails to apply on applier node.
It fails with error HA_ERR_SEQUENCE_INVALID_DATA 195 in
sequence_definition::check_and_adjust() because sequence variables
like min_value, max_value, start are 0.

The marking of all columns in 'TABLE::mark_columns_per_binlog_row_image()'
will prevent update/set column values for the sequence table.
For the sequence table column bitmap sent from master is only used.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-08-13 21:01:19 +02:00
Julius Goryavsky
abc5661c12 galera mtr tests: fix some tests after rebase to reflect recent changes 2025-08-13 20:41:22 +02:00
Jan Lindström
c24b4b92aa MDEV-36949 : unstable autoincrement value in galera_toi_ddl_nonconflicting test
Remove show create table because,

Test has two concurrent statements:
(1) ALTER TABLE t1 ADD COLUMN f3 INTEGER; INSERT INTO t1 VALUES (NULL, 10000, 10000);
(2) CREATE UNIQUE INDEX i1 ON t1(f2);

If INSERT starts execution and reaches certifying state and execution
is switched to CREATE, there will be MDL-conflict. This MDL-conflict is
resolved by BF-abort (brute force abort) i.e. INSERT is aborted.
But it has already acquired value for auto_increment
column from InnoDB. INSERT is then retryed and that will cause
new auto_increment value generation. Therefore, later SHOW CREATE
TABLE could show unstable values i.e. either value that is generated
on schedule where there was no retry and value where there was a retry.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-08-13 17:54:12 +02:00
Sergei Golubchik
c4ed889b74 Merge branch '10.11' into 11.4 2025-07-28 19:40:10 +02:00
Sergei Golubchik
053f9bcb5b Merge branch '10.6' into 10.11 2025-07-28 18:06:31 +02:00
Jan Lindström
56fbc0cdd7 MDEV-36953 : mysql-wsrep#198 test hangs
Test changes only. INSERT may fail for lock wait because
in other node we have LOCK TABLE or it may succeed
if next statement i.e. UNLOCK TABLES is fast enough.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-06-30 01:08:55 +02:00
Jan Lindström
fd1266a980 MDEV-34761 : Assertion `client_state_.mode() == wsrep::client_state::m_local' failed in int wsrep::transaction::after_statement(wsrep::unique_lock<wsrep::mutex>&)
@@enforce_storage_engine is local setting and there is no
knowledge how other nodes are configured. Statement
CREATE TABLE xxx ENGINE=yyy is replicated as it is and
if required engine != enforced engine it could lead
inconsistent used storage engine in the cluster.

Fix is to return error and a warning if required engine is not
same as enforced engine.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-06-30 00:57:56 +02:00
Oleksandr Byelkin
89c7e2b9c7 Merge branch '10.11' into 11.4 2025-06-17 09:50:22 +02:00
Marko Mäkelä
3da36fa130 Merge 10.6 into 10.11 2025-05-26 08:10:47 +03:00
Marko Mäkelä
1c7209e828 Merge 10.6 into 10.11 2025-05-21 07:36:35 +03:00
Jan Lindström
497d6324bc MDEV-36627 : galera.MDEV-29142: certification position less than last commited
After the membership change on a newly synced node, then this is just a
warning and safe to suppress.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-05-20 20:59:10 +02:00
Hemant Dangi
d38558f99b MDEV-36117: MDL BF-BF conflict on ALTER and UPDATE with multi-level foreign key parents
Issue:
Mariadb acquires additional MDL locks on UPDATE/INSERT/DELETE statements
on table with foreign keys. For example, table t1 references t2, an
UPDATE to t1 will MDL lock t2 in addition to t1.
A replica may deliver an ALTER t1 and UPDATE t2 concurrently for
applying. Then the UPDATE may acquire MDL lock for t1, followed by a
conflict when the ALTER attempts to MDL lock on t1. Causing a BF-BF
conflict.

Solution:
Additional keys for the referenced/foreign table needs to be added
to avoid potential MDL conflicts with concurrent update and DDLs.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-05-20 20:59:10 +02:00
Jan Lindström
a96367bc67 MDEV-36620 post-fix: galera_toi_ddl_nonconflicting test failure
Add wait_condition to wait until all inserted rows are replicated
so that show create table is deterministic.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-05-20 20:59:10 +02:00
Julius Goryavsky
2350295643 MDEV-36740: galera.galera_ssl_upgrade fails due to expired certificate
The certificate used in tests has been renewed.
2025-05-20 12:33:36 +02:00
Jan Lindström
d7457b4076 MDEV-36628 : galera_vote_during_ist test failed
Test changes only. Added wait_conditions to wait for expected
database state.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-05-20 12:30:40 +02:00
Oleksandr Byelkin
a8d4642375 Merge branch '10.11' into 11.4 2025-04-26 10:53:02 +02:00
Oleksandr Byelkin
4d41ec081e Merge branch '10.6' into 10.11 2025-04-26 10:47:03 +02:00
Oleksandr Byelkin
19644f6821 Merge branch '10.5' into 10.6 2025-04-26 10:41:52 +02:00
Jan Lindström
2f5c260f55 MDEV-36514 : galera_var_ignore_apply_errors test failure: table doesn't exist
Test changes only. Added proper wait_conditions to wait for expected
replication state.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-04-23 18:45:57 +02:00
Jan Lindström
76938eda9d MDEV-36625 : galera.galera_var_replicate_myisam_on test failure
Test case changes only. Add proper wait_conditions to wait expected
database state.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-04-23 18:45:11 +02:00
Jan Lindström
fe25a30a92 MDEV-36620 : galera_toi_ddl_nonconflicting test failure
Test changes only. Idea of the test is to test two concurrent
nonconflicting DDL-clauses. Therefore, use debug sync to
really execute two DDL-clauses as concurrently as Galera
allows.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-04-23 08:31:10 +02:00
Jan Lindström
67b6f9f285 MDEV-36618 : galera.galera_as_slave_nonprim test: result content mismatch
Remove unnecessary sleeps and use wait_for_slave_to_stop instead.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-04-22 20:46:51 +02:00
Julius Goryavsky
1a013cea95 Merge branch '10.6' into '10.11' 2025-04-16 03:34:40 +02:00
Julius Goryavsky
0403f0147f MDEV-33136: backport corrections from 10.11+ 2025-04-15 01:51:32 +02:00
Julius Goryavsky
88dfa6bcee Merge branch '10.5' into '10.6' 2025-04-15 01:49:48 +02:00
Julius Goryavsky
08f902e9ce MDEV-36116: correction for error codes 2025-04-14 18:20:25 +02:00
Alexey Yurchenko
77391482bd MDEV-34998: master can stop responding after cluster vote to evict a node
Additional corrections: there is a natural race between closing connection
to cluster in case of applying error and finishing the IST and sometimes
IST finishes and tries to send JOIN message over a closed connection.
This does not affect the correctness of the test or node behavior.
Added error message suppression.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-04-14 18:20:25 +02:00
Julius Goryavsky
bbd0e4b2c9 MDEV-34998 addendum: post-fix corrections for SST scripts
Delaying scripts on joiner after SST/IST has been made
a common debug feature for all suitable SST/IST methods.

Also some minor fixes have been made for new tests.
2025-04-14 18:20:25 +02:00
Alexey Yurchenko
ec5068fe59 MDEV-34998: master can stop responding after cluster vote to evict a node
After cluster vote to evict a node that failed a transaction,
current master can't commit anymore.

Error voting for joiner in the JOINED state was broken because
the group-wide commit cut (implicit SUCCESS vote) was not taken
into account when processing error vote request from the JOINED
node.

This commit adds 3 MTR tests to verify the fix in the galera
library works as designed.

Requires Galera library commit 91f0090a05e96c3cc353b80d961ede45cefb9279
(galera library version > 26.4.19).

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-04-14 18:20:25 +02:00
Marko Mäkelä
3ae8f114e2 Merge 10.11 into 11.4 2025-04-02 10:15:08 +03:00
Julius Goryavsky
74f0b99edf Merge branch '10.6' into '10.11' 2025-04-02 06:33:39 +02:00
Julius Goryavsky
b983a911e9 galera mtr tests: synchronization between branches and editions 2025-04-02 04:50:11 +02:00
Julius Goryavsky
03c31ab099 Merge branch '10.5' into '10.6' 2025-04-02 04:43:24 +02:00
Jan Lindström
25737dbab7 MDEV-33850 : For Galera, create sequence with low cache got signal 6 error: [ERROR] WSREP: FSM: no such a transition REPLICATING -> COMMITTED
Problem was that transacton was BF-aborted after certification
succeeded and transaction tried to rollback and during
rollback binlog stmt cache containing sequence value reservations
was written into binlog.

Transaction must replay because certification succeeded but
transaction must not be written into binlog yet, it will
be done during commit after the replay.

Fix is to skip binlog write if transaction must replay and
in replay we need to reset binlog stmt cache.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-04-02 04:29:40 +02:00
Denis Protivensky
dd54ce9e10 MDEV-36116: Remove debug assert in TOI when executing thread is killed
Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-04-02 04:29:40 +02:00
Julius Goryavsky
fa55b36c1e galera tests: corrections for garbd-related tests 2025-04-02 04:29:40 +02:00
Julius Goryavsky
41565615c5 galera: synchronization changes to stop random test failures 2025-04-02 04:29:34 +02:00
Marko Mäkelä
f5bd250f5b Merge 10.11 into 11.4 2025-03-28 13:55:21 +02:00
Julius Goryavsky
c61345169a galera tests: synchronization after merge 2025-03-28 02:53:59 +01:00
Marko Mäkelä
9a6540cb84 MDEV-29445 fixup: galera_sst_mariabackup_use_memory
The mariadb-backup --use-memory parameter will be trimmed to a multiple
of 8 MiB, or 2 MiB on 32-bit systems.

Also, let us remove a bogus message in mariadb-backup:
Warning: option 'use-memory': signed value -1 adjusted to 8388608
2025-03-27 08:54:00 +02:00
Marko Mäkelä
d68f5ea9f0 MDEV-35000 fixup: galera.MDEV-33136
TRUNCATE TABLE will no longer cause a reload of InnoDB statistics.
RENAME TABLE will.
2025-03-27 08:19:40 +02:00
Marko Mäkelä
ab0f2a00b6 Merge 10.6 into 10.11 2025-03-27 08:01:47 +02:00