Skip to content

Spread:Different records for the same table of a single MySQL are distributed to multiple MySQL+where+timestamp, is not support incremental replication +(binglog-sql).  #301

Closed
@zhangjingwen198817

Description

@zhangjingwen198817

Problem Description:
The data of the same table in mysql is distributed and copied through the timestamp (binglog-sql), the target database can't sync the insert data

Version:(git: master bbabd4f)

Prepare Test Environment:
Prepare 3 mysql instances on different hosts.(for example:10.196.30.94 ,10.186.30.90, 10.186.30.7 )

Steps To Reproduce:
Step1: execute the below mysql statements on source database (10.186.30.94):

create database testHA;
use testha;
CREATE TABLE t (
  id int,
  uname varchar(20) DEFAULT NULL,
  ts timestamp,
  age int(11) DEFAULT NULL,
  primary KEY `id` (`id`)
);

delimiter $$
create procedure ts()
begin
declare v_cnt decimal (10)  default 0 ;
declare add_id int default 0;
dd:loop
          insert  into t values
          (add_id,'用户',from_unixtime(unix_timestamp('2018-09-07 10:33:25')+86400*add_id),20);
                  commit;
                    set v_cnt = v_cnt+1 ;
                     set add_id=add_id+1;
                           if  v_cnt = 19 then leave dd;
                          end if;
         end loop dd ;
end;$$
delimiter ;
call   ts;

Step2: Create two tasks on Dtle to complete the following scenario,different records for the same table of a single MySQL are distributed to multiple MySQL.

Step3: start two tasks with the attachment scripts.
job1.json.txt
job2.json.txt

 "Tables": [
              {
                "TableName": "t",
                "where":"unix_timestamp(ts)>=unix_timestamp('2018-09-07 10:33:25')+86400*10"
              }

For example:
curl -H "Accept:application/json" -XPOST "10.186.30.94:8190/v1/jobs" -d @job1.json
curl -H "Accept:application/json" -XPOST "10.186.30.94:8190/v1/jobs" -d @job2.json

Step4: execute the below mysql statement on source database(10.186.30.94).

insert into t values(20,'用户',from_unixtime(unix_timestamp('2018-09-07 10:33:25')+86400*20),20); 

Actual Resluts:
1.The target database can't sync the insert data
2.The Dtle have the below log:
1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions