← Back to team overview

maria-developers team mailing list archive

Re: MDEV-4255 MIXED replication: Unique key updates are not marked unsafe, replication fails in lp:~maria-captains/maria/10.0


On Sat, Nov 29, 2014 at 10:23 AM, Sergei Golubchik <serg@xxxxxxxxxxx> wrote:
> Hi, Pavel!
> On Nov 29, Pavel Ivanov wrote:
>> A note from a peanut gallery: I think issuing a warning only when an
>> actual conflict occurs is a bad idea, because due to a specific row
>> order conflict may not occur on the master, but occur on slaves. And
>> that can lead to a very bad replication breakage.
> Is that possible? I mean, a unique key conflict either occurs or it
> doesn't. I don't see yet how a row order might affect that.

A simple example could be like this:

create table t (id int primary key, n int unique);
insert into t values (1, 3);
insert into t values (2, 2);
update t set n = n + 1 where n >= 2;

Here if master chooses to use PRIMARY index to scan the table it will
update both rows without any unique key conflicts. If after that slave
chooses to use the unique index on n to scan the table it will get a
conflict and the statement will fail.