mariadb/include/mysql
Denis Protivensky 231900e5bb MDEV-34836: TOI on parent table must BF abort SR in progress on a child
Applied SR transaction on the child table was not BF aborted by TOI running
on the parent table for several reasons:

Although SR correctly collected FK-referenced keys to parent, TOI in Galera
disregards common certification index and simply sets itself to depend on
the latest certified write set seqno.

Since this write set was the fragment of SR transaction, TOI was allowed to
run in parallel with SR presuming it would BF abort the latter.

At the same time, DML transactions in the server don't grab MDL locks on
FK-referenced tables, thus parent table wasn't protected by an MDL lock from
SR and it couldn't provoke MDL lock conflict for TOI to BF abort SR transaction.

In InnoDB, DDL transactions grab shared MDL locks on child tables, which is not
enough to trigger MDL conflict in Galera.

InnoDB-level Wsrep patch didn't contain correct conflict resolution logic due to
the fact that it was believed MDL locking should always produce conflicts correctly.

The fix brings conflict resolution rules similar to MDL-level checks to InnoDB,
thus accounting for the problematic case.

Apart from that, wsrep_thd_is_SR() is patched to return true only for executing
SR transactions. It should be safe as any other SR state is either the same as
for any single write set (thus making the two logically equivalent), or it reflects
an SR transaction as being aborting or prepared, which is handled separately in
BF-aborting logic, and for regular execution path it should not matter at all.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2024-09-24 11:14:01 +02:00
..
psi Merge branch '10.5' into 10.6 2023-12-17 11:20:43 +01:00
auth_dialog_client.h
client_plugin.h
client_plugin.h.pp
plugin.h MDEV-32559 failing spider signal_ddl_recovery_done callback should result in spider deinit 2024-01-16 17:17:50 +11:00
plugin_audit.h
plugin_audit.h.pp Merge branch '10.5' into 10.6 2023-12-17 11:20:43 +01:00
plugin_auth.h MDEV-27341 Use SET PASSWORD to change PAM service 2022-01-17 18:19:29 +01:00
plugin_auth.h.pp Merge branch '10.5' into 10.6 2023-12-17 11:20:43 +01:00
plugin_auth_common.h
plugin_data_type.h
plugin_data_type.h.pp Merge branch '10.5' into 10.6 2023-12-17 11:20:43 +01:00
plugin_encryption.h
plugin_encryption.h.pp Merge branch '10.5' into 10.6 2023-12-17 11:20:43 +01:00
plugin_ftparser.h header typos 2022-12-20 08:55:48 +11:00
plugin_ftparser.h.pp Merge branch '10.5' into 10.6 2023-12-17 11:20:43 +01:00
plugin_function.h
plugin_function.h.pp Merge branch '10.5' into 10.6 2023-12-17 11:20:43 +01:00
plugin_password_validation.h
plugin_password_validation.h.pp Merge branch '10.5' into 10.6 2023-12-17 11:20:43 +01:00
service_base64.h header typos 2022-12-20 08:55:48 +11:00
service_debug_sync.h
service_encryption.h post fix for "move alloca() definition from all *.h files to one new header file" 2023-03-08 17:36:36 +01:00
service_encryption_scheme.h
service_json.h Improve documentation of json parser functions 2021-07-22 21:51:49 +03:00
service_kill_statement.h
service_logger.h
service_md5.h
service_my_crypt.h post-merge fix 2023-09-13 12:10:43 +02:00
service_my_print_error.h
service_my_snprintf.h header typos 2022-12-20 08:55:48 +11:00
service_print_check_msg.h MDEV-33277 In-place upgrade causes invalid AUTO_INCREMENT values 2024-02-08 10:35:45 +02:00
service_progress_report.h
service_sha1.h
service_sha2.h
service_sql.h MDEV-27295 Backport SQL service, introduced by MDEV-19275. 2023-11-05 23:35:32 +04:00
service_thd_alloc.h
service_thd_autoinc.h
service_thd_error_context.h
service_thd_mdl.h
service_thd_rnd.h
service_thd_specifics.h
service_thd_timezone.h header typos 2022-12-20 08:55:48 +11:00
service_thd_wait.h
service_wsrep.h MDEV-34836: TOI on parent table must BF abort SR in progress on a child 2024-09-24 11:14:01 +02:00
services.h MDEV-27595 Backport SQL service, introduced by MDEV-19275. 2023-11-05 23:35:31 +04:00