dtle icon indicating copy to clipboard operation
dtle copied to clipboard

Aggregation:Tables of multiple databases are merged into table of a single database (Incremental replication),when create foreign key the Dtle will be 'shut down'

Open actiontech-bot opened this issue 6 years ago • 0 comments

Problem Description: when create foreign key at both source databases at the same time ,the Dtle will be 'shut down'.

Version: (git: master 147486546751e611606d35dd6fe56ef9a1b25963)

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

Dtle deploy:
+---------------------------------------------------------------------+
host        |   dtle(manager/agent) |   mysql                        |
10.186.30.94|  manager/agent       |  mysql source-database-one      |
10.186.30.90|  agent               |  mysql source-database-two      |
10.186.30.7 |  agent               |  mysql target-database          |
+---------------------------------------------------------------------+

Steps To Reproduce:

Step 1: execute the below mysql statements on three database (10.186.30.94) , (10.186.30.90)and (10.186.30.7):

create database bjaction002;

Step 2: create two repository level's jobs on Dtle to merge two source database's data to target database's table. For exanple:

"ReplicateDoDb": [
                 {
                    "TableSchema": "bjaction002",
                    "Tables": []
                }
            ],

Step 3: execute the below statement on two source databases at same time:

 create table warehouse (
     w_id smallint not null,
     w_name varchar(10),
     w_street_1 varchar(20),
     w_street_2 varchar(20),
     w_city varchar(20),
     w_state char(2),
     w_zip char(9),
     w_tax decimal(4,2),
     w_ytd decimal(12,2),
     primary key (w_id) ) Engine=InnoDB;

 create table stock (
     s_i_id int not null,
     s_w_id smallint not null,
     s_quantity smallint,
     s_ytd decimal(8,0),
     s_order_cnt smallint,
     s_remote_cnt smallint,
     s_data varchar(50),
     PRIMARY KEY(s_w_id, s_i_id) ) Engine=InnoDB ;

 ALTER TABLE stock ADD CONSTRAINT fkey_stock_1 FOREIGN KEY(s_w_id) REFERENCES warehouse(w_id);

Step 4: check the ‘udup.log' and general-log

Actual result:

  1. when execute the statement of 'Alter table xxx', one job will be 'shut down'

Below is screenshot: image image

actiontech-bot avatar Sep 05 '18 07:09 actiontech-bot