mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-28530: Revoking privileges from a non-existing user on a master breaks replication on the slave in the presence of replication filters
Problem: ======== Replication can break while applying a query log event if its respective command errors on the primary, but is ignored by the replication filter within Grant_tables on the replica. The bug reported by MDEV-28530 shows this with REVOKE ALL PRIVILEGES using a non-existent user. The primary will binlog the REVOKE command with an error code, and the replica will think the command executed with success because the replication filter will ignore the command while accessing the Grant_tables classes. When the replica performs an error check, it sees the difference between the error codes, and replication breaks. Solution: ======== If the replication filter check done by Grant_tables logic ignores the tables, reset thd->slave_expected_error to 0 so that Query_log_event::do_apply_event() can be made aware that the underlying query was ignored when it compares errors. Note that this bug also effects DROP USER if not all users exist in the provided list, and the patch fixes and tests this case. Reviewed By: ============ andrei.elkin@mariadb.com
This commit is contained in:
committed by
Andrei
parent
e4cffc92c7
commit
47812017c6
@ -3209,6 +3209,8 @@ public:
|
||||
/*
|
||||
In case of a slave, set to the error code the master got when executing
|
||||
the query. 0 if no error on the master.
|
||||
The stored into variable master error code may get reset inside
|
||||
execution stack when the event turns out to be ignored.
|
||||
*/
|
||||
int slave_expected_error;
|
||||
enum_sql_command last_sql_command; // Last sql_command exceuted in mysql_execute_command()
|
||||
|
Reference in New Issue
Block a user