Not the answer you need?
Register and ask your own question!

TokuDB Read Free Replication bug.

carakodcarakod EntrantCurrent User Role Beginner
If your table is lacking PK, update, delete events will not propagate reliably and eventually will create a data inconsistency.
I use 5.6.27-76.0-log Percona Server (GPL), Release 76.0 1(Master) -> 2(Slaves)
Slaves: read-only, RBR, tokudb_rpl_unique_checks = 0, tokudb_rpl_lookup_rows = 0

I drop id column with PK in world.City table.
on Master and Slaves:
☭ [world]> select * from City where Name = 'Amsterdam';
+
+
+
+
+
+
| Name | CountryCode | District | Population | RollupDate |
+
+
+
+
+
+
| Amsterdam | NLD | Noord-Holland | 731200 | 2015-02-10 |

Master:
update City set Population = Population + 10 where Name = 'Amsterdam';

After the update:
Master:
☭ [world]> select * from City where Name = 'Amsterdam';
+
+
+
+
+
+
| Name | CountryCode | District | Population | RollupDate |
+
+
+
+
+
+
| Amsterdam | NLD | Noord-Holland | 731210 | 2015-02-10 |
+
+
+
+
+
+

Slave1:
☭ [world]> select * from City where Name = 'Amsterdam';
+
+
+
+
+
+
| Name | CountryCode | District | Population | RollupDate |
+
+
+
+
+
+
| Amsterdam | NLD | Noord-Holland | 731210 | 2015-02-10 |
+
+
+
+
+
+


Slave2 extra row:
☭ [world]> select * from City where Name = 'Amsterdam';
+
+
+
+
+
+
| Name | CountryCode | District | Population | RollupDate |
+
+
+
+
+
+
| Amsterdam | NLD | Noord-Holland | 731200 | 2015-02-10 |
| Amsterdam | NLD | Noord-Holland | 731210 | 2015-02-10 |
+
+
+
+
+
+

Now after I run delete on Master:
☭ [world]> delete from City where Name = 'Amsterdam';
Query OK, 1 row affected (0.00 sec)

on Master:
☭ [world]> select * from City where Name = 'Amsterdam';
Empty set (0.00 sec)

Slave1:
☭ [world]> select * from City where Name = 'Amsterdam';
Empty set (0.00 sec)

Slave2:
☭ [world]> select * from City where Name = 'Amsterdam';
+
+
+
+
+
+
| Name | CountryCode | District | Population | RollupDate |
+
+
+
+
+
+
| Amsterdam | NLD | Noord-Holland | 731200 | 2015-02-10 |
+
+
+
+
+
+

As we see neither updates no deletes are reliable with RFR on on the table with no PK creating data inconsistency.
This needs to be emphasised in the Documentation or even better needs to be fixed.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.