Skip to content

Problem in loop replication detection #592

Closed
@ghost

Description

Case

A <--dtle --> B

  1. Prepare data on both sides
create schema if not exists a592;
create table a592.a (id int primary key auto_increment);
insert into a592.a values (1);
  1. run the 2 jobs

  2. exec on side A

set gtid_next = '11111111-1111-1111-1111-111111111111:1';
update a592.a set id = 111 where id = 1;
set gtid_next = 'automatic';
insert into a592.a values (1);
  1. The TX is replicated to B (which is normal)

  2. The TX is replicated to A again (which it should not), since the OSID is not A's uuid.

   [ERROR] client.driver_mgr.dtle: error at exec: driver=dtle @module=dtle.applier.ApplyBinlogEvent err="Error 1062: Duplicate entry '111' for key 'PRIMARY'" gtid=b0f42144-06cd-11e9-93ca-02000aba3e28:74 job=aa2 timestamp=2021-02-25T17:56:21.693+0800

We should check whether a tx has been executed based on target gtid_executed instead of uuid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions