Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle query_event COMMIT #1062

Open
ghost opened this issue Jun 27, 2023 · 2 comments
Open

handle query_event COMMIT #1062

ghost opened this issue Jun 27, 2023 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 27, 2023

#1059 中出现了 query_event query="COMMIT" 的情况

[WARN] reader: mysql.reader: QueryEvent is not recognized. will still execute: job=dtle-track query=COMMIT gno=89248399

原场景(RDS 5.6)未能复现.

但发现如下case可触发

set gtid_next = 'some_uuid:some_gno';
begin;
commit;
-- binlog中形成query_event BEGIN 和 COMMIT的空事务

需验证dtle能否处理此场景及后续复制.

已知在gtid_next='automatic'时, 空事务不会写入binlog.

@ghost
Copy link
Author

ghost commented Jun 28, 2023

dtle 行为

未识别query, 但放行至目标端
    2023-06-28T10:47:33.942+0800 [WARN]  client.driver_mgr.dtle: mysql.reader: QueryEvent is not recognized. will still execute: driver=dtle gno=5 job=a1 query=COMMIT @module=reader timestamp="2023-06-28T10:47:33.942+0800"
目标端执行COMMIT query (非dtle固有的提交流程)
    2023-06-28T10:47:33.942+0800 [DEBUG] client.driver_mgr.dtle: execQuery: driver=dtle @module=dtle.applier job=a1 query="COMMIT /*dtle_gtid1 a1 00003307-1111-1111-1111-111111111112 5 dtle_gtid*/" timestamp="2023-06-28T10:47:33.942+0800"
dtle 写入gtid_executed
    2023-06-28T10:47:33.955+0800 [DEBUG] client.driver_mgr.dtle: insert gno: driver=dtle gno=5 job=a1 rows=0 @module=dtle.applier.ApplyBinlogEvent timestamp="2023-06-28T10:47:33.955+0800"
dtle提交(固有流程)
    2023-06-28T10:47:33.970+0800 [DEBUG] client.driver_mgr.dtle: applier tx committed: driver=dtle gno=5 job=a1 rows=0 @module=dtle.applier.ApplyBinlogEvent timestamp="2023-06-28T10:47:33.969+0800"

后续复制正常执行.

ghost pushed a commit that referenced this issue Jun 28, 2023
@ghost
Copy link
Author

ghost commented Jun 28, 2023

一般DML事务和DDL事务都不会出现query_event COMMIT. 该场景产生原因及影响仍不明.

9db0c33: 不再提示not recognized, 而是提示:

[WARN]  client.driver_mgr.dtle: found query_event COMMIT. Please report the case at #1062: driver=dtle @module=reader gno=6 job=a1 timestamp="2023-06-28T16:09:35.321+0800"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants