drop partition DDL should not be synchronized immediately.
For example:
-- source and target table tab2 metadata
CREATE TABLE sbtest.tab2 (
id INT NOT NULL,
date DATE NOT NULL,
value VARCHAR(50),
PRIMARY KEY (id, date)
)
PARTITION BY RANGE (YEAR(date)) (
PARTITION p0 VALUES LESS THAN (2000),
PARTITION p1 VALUES LESS THAN (2005),
PARTITION p2 VALUES LESS THAN (2010),
PARTITION pmax VALUES LESS THAN MAXVALUE
);
-- mysql1 (source1)
mysql> ALTER TABLE sbtest.tab2 drop partition pmax;
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
-- tidb (target) , drop partition DDL synchronized immediately
mysql> show create table tab2;
CREATE TABLE `tab2` (
`id` int(11) NOT NULL,
`date` date NOT NULL,
`value` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`,`date`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
PARTITION BY RANGE (YEAR(`date`))
(PARTITION `p0` VALUES LESS THAN (2000),
PARTITION `p1` VALUES LESS THAN (2005),
PARTITION `p2` VALUES LESS THAN (2010))
-- mysql2 (source2)
mysql> insert into sbtest.tab2 values(2,'2023-01-01','a');
Query OK, 1 row affected (0.00 sec)
-- tidb (target), DM reports an error and the data is not synchronized
mysql> select * from tab2;
Empty set (0.00 sec)
What did you expect to see?
-- tidb (target)
mysql> select * from tab2;
+----+------------+-------+
| id | date | value |
+----+------------+-------+
| 2 | 2023-01-01 | a |
+----+------------+-------+
1 row in set (0.00 sec)
What did you see instead?
-- tidb (target), DM reports an error and the data is not synchronized
mysql> select * from tab2;
Empty set (0.00 sec)
Versions of the cluster
DM version (run dmctl -V or dm-worker -V or dm-master -V):
6.5.0
Upstream MySQL/MariaDB server version:
MySQL 5.7.19
Downstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):
6.5.0
How did you deploy DM: tiup or manually?
tiup
Other interesting information (system version, hardware config, etc):
>
>
current status of DM cluster (execute query-status <task-name> in dmctl)
What did you do?
drop partition DDL should not be synchronized immediately. For example:
What did you expect to see?
What did you see instead?
Versions of the cluster
DM version (run
dmctl -V
ordm-worker -V
ordm-master -V
):Upstream MySQL/MariaDB server version:
Downstream TiDB cluster version (execute
SELECT tidb_version();
in a MySQL client):How did you deploy DM: tiup or manually?
Other interesting information (system version, hardware config, etc):
current status of DM cluster (execute
query-status <task-name>
in dmctl)