DCL commands are not replicated witch certain replication filters

Description

Description:

If replica has filter --replicate-ignore-db=mysql and a DCL statement is issued in another database it is still replicated.

However, if I add an additional filter replicate-do-table a DCL would not be recorded even if it is executed in the database, not related to the table filter.

This contradicts with both
https://dev.mysql.com/doc/refman/8.0/en/replication-rules-examples.html
and behavior, considered correct, in
bug #70877
 
How to repeat:
1. DCL statement is replicated.

On the replica:

stop slave; change replication filter REPLICATE_IGNORE_DB = (mysql); start slave;

On the source:

use test; create user replicated1;

On the replica:

select user, host from mysql.user; user host replicated1 % ...

This behavior is correct and expected.

2. DCLs are not replicated.

On the same replica:

stop slave; change replication filter REPLICATE_DO_TABLE = (db1.foo); start slave;

On the source:

create database db1; use test; create user not_replicated; use db1; create user also_not_replicated; select user, host from mysql.user; user host also_not_replicated % not_replicated % ...

On the replica:

select user, host from mysql.user; user host replicated1 % root 127.0.0.1 root ::1 root delly-7390 mysql.session localhost mysql.sys localhost root localhost

See also attached test case for MTR

Suggested fix:
Replicate DCL statements no matter of table filters.

Environment

None

AFFECTED CS IDs

CS0014875

Attachments

1
  • 31 Dec 2020, 11:13 AM

Confluence content

mentioned on

Smart Checklist

Activity

Show:

Anton Matvienko April 15, 2022 at 4:40 PM

(Copied from Slack, Artyom Belov says)

replicate-ignore-db only works for the default database, as described in the documentation.
But replicate-do-table  just disables all replication except for the given table. Documentation: "This works for both cross-database updates and default database updates, in contrast to --replicate-do-db. "
I don't see a bug.

Cannot Reproduce

Details

Assignee

Reporter

Affects versions

Priority

Smart Checklist

Created December 31, 2020 at 11:02 AM
Updated March 6, 2024 at 10:46 AM
Resolved June 1, 2022 at 10:01 AM

Flag notifications