[MDEV-7506] Bellow Blackhole engine, update with inner join you'll end up with inconsistent data in your database Created: 2015-01-27 Updated: 2015-02-04 Resolved: 2015-02-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Affects Version/s: | 10.0.15 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Tsao | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
master database use MySQL 5.1 , slave level 1 database use Mariadb 10.0.15 , slave level 2 database use MySQL5.1 or MySQL5.6 or Mariadb. |
||
| Description |
|
Environment: sample: MySQL 5.1→Mariadb 10.0.15(level 1)→Mariadb 10.0.15(level 2) 1, master database:
2, slave level 1 database:
3, master database:
4, slave level 2 database:
– You can find the data did not update 5, master database:
6, slave level 2 database:
|
| Comments |
| Comment by Elena Stepanova [ 2015-01-27 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Could you please provide
Thanks. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Tsao [ 2015-01-28 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
binary logs from master:
binary logs from slave level 1:
– You can find the bellow sql did't in the slave level 1:
"show slave status" is running status is ok; PS: master,slave level 1 and slave level 2 the binlog_format is all MIXED
slave level 1(mariadb):
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-02-03 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Okay, thanks, this will do. On both servers (here and further I will talk about master and slave1, slave2 is unimportant here) you have mixed binlog format. But since you're in MBR mode, no warnings are issued, instead the server switches to row-based binlog format. The true multi-table update (the one with 'd10') is not considered unsafe for SBR; so, it stays in statement format and is written to the binary log. Whether it's a wise exception or a miss, can probably be investigated, but as I understand it's not a complaint in your case. So, if you want this setup to work, you should probably switch both servers to SBR. Switching only slave1 is dangerous, because if at some point the master sends any row event, the replication will break, as the slave won't be able to log it. Do you find this explanation satisfactory, or do you have any other questions/concerns regarding the problem? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Tsao [ 2015-02-04 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you. if I want keep this setup, master use MySQL5.1, slave level 1 use MariaDB(blackhole engine), slave level 2 use MySQL5.1. mysql> ALTER TABLE z1 CHANGE id id INT NOT NULL ; mysql> ALTER TABLE z2 CHANGE id id INT NOT NULL ; mysql> then update sql execute on the master, it can sync to the slave level 2. Can I use like this? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-02-04 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
If you always insert explicit values for the PK, it should work all right. On a separate note, I would advise against replicating from a newer server to an older server (as you are planning to replicate from 10.0 to 5.1) if you can avoid it. It is supported on a best effort basis, but generally is not guaranteed to work. |