1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-30323 Some DDLs like ANALYZE can complete on parallel slave out of order

ANALYZE was observed to race over a preceding in binlog order DML
in updating the binlog and slave gtid states.

Tagging ANALYZE and other admin class commands in binlog by the fixes
of MDEV-17515 left a flaw allowing such race leading to
the gtid mode out-of-order error.
This is fixed now to observe by ADMIN commands the ordered access to
the slave gtid status variables and binlog.
This commit is contained in:
Andrei
2023-01-05 20:08:01 +02:00
parent 3aa04c0deb
commit 7fe932444d
4 changed files with 237 additions and 3 deletions

View File

@ -1249,16 +1249,16 @@ send_result_message:
goto err;
DEBUG_SYNC(thd, "admin_command_kill_after_modify");
}
thd->resume_subsequent_commits(suspended_wfc);
DBUG_EXECUTE_IF("inject_analyze_table_sleep", my_sleep(500000););
if (is_table_modified && is_cmd_replicated &&
(!opt_readonly || thd->slave_thread) && !thd->lex->no_write_to_binlog)
{
if (write_bin_log(thd, TRUE, thd->query(), thd->query_length()))
goto err;
}
my_eof(thd);
thd->resume_subsequent_commits(suspended_wfc);
DBUG_EXECUTE_IF("inject_analyze_table_sleep", my_sleep(500000););
DBUG_RETURN(FALSE);
err: