TL;DR: unless you know what you are doing, you should always have a primary key on your tables when replicating in RBR (and maybe even all the time).
TL;DR2: MariaDB 10.1 has an interesting way to protect against missing a primary key (innodb_force_primary_key) but it could be improved.
A few weeks ago, I was called off hours because replication delay on all the slaves from a replication chain was high and growing. It was not the first time this happened on that chain, so I thought right away that this was probably an UPDATE or DELETE of many rows on a table without a primary key. Let's see what is the problem with this and to understand that, we have to talk about binary log formats.
Showing posts with label SBR. Show all posts
Showing posts with label SBR. Show all posts
Wednesday, August 16, 2017
The danger of no Primary Key when replicating in RBR (and a partial protection with MariaDB 10.1)
Labels:
Binary Logs,
foot-gun,
InnoDB,
MariaDB 10.1,
MariaDB Server,
MySQL,
MySQL 5.7,
MySQL 8.0,
ps-top,
RBR,
Replication,
Row-Based Replication,
SBR,
Statement-Based Replication,
War Story
Friday, January 13, 2017
Funny replication breakage of Friday, January 13
A funny replication breakage kept me at the office longer than expected today (Friday 13 is not kind with me).
So question of the day: can you guess what the below UPDATE statement does (or what is wrong with it) ?
So question of the day: can you guess what the below UPDATE statement does (or what is wrong with it) ?
Labels:
MariaDB,
MariaDB 10.0,
MariaDB 10.1,
MySQL,
RBR,
Replication,
Row-Based Replication,
SBR,
Statement-Based Replication
Wednesday, August 13, 2014
SBR vs RBR when using On Duplicate Key Update for High Availability
The other day, I was discussing high availability (HA) with other people. The discussion was going in the direction of, as the application was only using INSERT ... ON DUPLICATE KEY UPDATE (IODKU) and traffic could be replayed, promoting a slave in case of the failure of the master was easy: replaying traffic would make& all the slaves converge back to a common state. It looks as this could work but it might not be as simple. Before going into the details, let's take a step back and look into HA in general.
tl;dr: be careful when using row-based replication when replicating IODKU as slaves will stop replicating if a row is present on the master and missing on slave (or vice-versa).
tl;dr: be careful when using row-based replication when replicating IODKU as slaves will stop replicating if a row is present on the master and missing on slave (or vice-versa).
Labels:
HA,
High Availability,
IODKU,
ODKU,
RBR,
Row-Based Replication,
SBR,
Statement-Based Replication
Subscribe to:
Posts (Atom)