Bug #43457 | replicate-ignore-db behaves differently with different binlog formats | ||
---|---|---|---|
Submitted: | 6 Mar 2009 14:24 | Modified: | 11 Apr 2018 13:22 |
Reporter: | Luis Soares | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S3 (Non-critical) |
Version: | 5.1, 6.0 | OS: | Any |
Assigned to: | Assigned Account | CPU Architecture: | Any |
Tags: | binlog format, filter, replicate-ignore-db, replication |
[6 Mar 2009 14:24]
Luis Soares
[6 Mar 2009 21:27]
Sveta Smirnova
See bug #43296 also.
[13 Mar 2009 7:20]
Sveta Smirnova
Thank you for the report. Verified as described.
[30 Mar 2009 10:09]
Mats Kindahl
Statement-based replication currently uses the current database when filtering because for statements like update table db1.t1, db2.t1 set db1.t1.a = db2.t1.a where db1.t1.a = 1; it is very hard to analyze if this statement should be filtered out if db1 (or db2) is filtered out. However, for filtering on the slave side, it might be possible to do something along these lines: - Introduce a "table dummy" on the slave side where tables can be opened as dummies. These tables should behave as blackhole, but should not have to be explicitly created. - With each statement, attach a list of tables and if they are read or written. This information is already available, but is not written to the binary log. - On the slave, substitute table dummies for all tables *written* by the statement where the tables are filtered out either because they are in a database that is filtered out, or because they are explicitly filtered out. - Execute the statement. This will throw away anything written to the dummy tables, but allow the statement to be executed normally. Note that it is not possible to substitute dummies for tables that are filtered out and *read*, since blackhole will return an empty result in this case, leading to inconsistencies between master and slave. If any tables that is read is filtered out, the statement cannot be replicated properly and an error should be thrown.