tiflow
tiflow copied to clipboard
Can not skip `DROP PROCEDURE` with schema-pattern
What did you do?
upstream
use db;
/*!*/ DROP PROCEDURE `xxx`
task config
filters:
filter-rule-1:
schema-pattern: "db"
sql-pattern: [".*\\s+DROP\\s+PROCEDURE"]
action: Ignore
What did you expect to see?
no error occurs
What did you see instead?
"result": {
"isCanceled": false,
"errors": [
{
"ErrCode": 36067,
"ErrClass": "sync-unit",
"ErrScope": "internal",
"ErrLevel": "high",
"Message": "startLocation: [position: (mysql-bin.000001, 1849), gtid-set: ], endLocation: [position: (mysql-bin.000001, 1970), gtid-set: ], origin SQL: [/*!*/ DROP PROCEDURE IF EXISTS `xxx`]: parse DDL: /*!*/ DROP PROCEDURE IF EXISTS `xxx`",
"RawCause": "line 1 column 20 near \"PROCEDURE IF EXISTS `xxx`\" ",
"Workaround": "Please confirm your DDL statement is correct and needed. For TiDB compatible DDL, see https://docs.pingcap.com/tidb/stable/mysql-compatibility#ddl. You can use `handle-error` command to skip or replace the DDL or add a binlog filter rule to ignore it if the DDL is not needed."
}
],
"detail": null
},
Versions of the cluster
DM version (run dmctl -V
or dm-worker -V
or dm-master -V
):
master
current status of DM cluster (execute query-status <task-name>
in dmctl)
(paste current status of DM cluster here)
with an all schema pattern, the event was skipped correctly.
filters:
filter-rule-1:
schema-pattern: "*"
sql-pattern: [".*\\s+DROP\\s+PROCEDURE"]
action: Ignore
@okJiang PTAL. Seems we still try to parse some DDLs that tidb doesn't support.
Maybe you are confused with events
and sql-pattern
. You can try again with sql-pattern
. @GMHDBJD
with an all schema pattern, the event was skipped correctly.
filters: filter-rule-1: schema-pattern: "*" events: [".*\\s+DROP\\s+PROCEDURE"] action: Ignore
So I think this is expected behavior. For DDLs that tidb don't support, we won't know the related db/table schema, so the schema pattern must be set as *
.
We may add a NOTE
in our doc for this.
Maybe you are confused with
events
andsql-pattern
. You can try again withsql-pattern
. @GMHDBJD
My fault,update
with an all schema pattern, the event was skipped correctly.
filters: filter-rule-1: schema-pattern: "*" events: [".*\\s+DROP\\s+PROCEDURE"] action: Ignore
So I think this is expected behavior. For DDLs that tidb don't support, we won't know the related db/table schema, so the schema pattern must be set as
*
.We may add a
NOTE
in our doc for this.
Yes, but our docs is wrong,https://docs.pingcap.com/zh/tidb-data-migration/stable/key-features#binlog-event-filter Also if we have different behavior between DDLs(whether TiDB support or not), users will be confused
assign to @liumengya94 as beginner's issue