Skip to content

big tx stuck at cleanGtidExecuted -> WaitForAllCommitted #1040

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

Closed
ghost opened this issue Jan 18, 2023 · 0 comments
Closed

big tx stuck at cleanGtidExecuted -> WaitForAllCommitted #1040

ghost opened this issue Jan 18, 2023 · 0 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Jan 18, 2023

前言: 关于目标端dtle.gtid_executed表

  • 每执行一个tx, 增加一行记录, 记录job_name, server_uuid, gno
  • 对于每个job每个server_uuid, 每2048行进行一次汇总, 将gtid以区间形式写入

复现

  1. 启动增量任务
  2. 该任务下执行若干小事务, 使记录行数接近2048
  3. 执行大事务
    • dtle中, 大事务分割成多个DataEntry执行, 执行完最后一个才进行commit
  4. 大事务卡住

delve debug可发现卡在如下位置

2  0x0000000002691ecf in github.com/actiontech/dtle/driver/mysql.(*MtsManager).WaitForAllCommitted
   at /universe/src/github.com/actiontech/dtle/driver/mysql/applier_mts.go:66
3  0x0000000002687d29 in github.com/actiontech/dtle/driver/mysql.(*ApplierIncr).cleanGtidExecuted
   at /universe/src/github.com/actiontech/dtle/driver/mysql/applier_gtid_executed.go:249
4  0x000000000268bd09 in github.com/actiontech/dtle/driver/mysql.(*ApplierIncr).handleEntry
   at /universe/src/github.com/actiontech/dtle/driver/mysql/applier_incr.go:309

问题

  • 大事务中对于dtle.gtid_executed行数的计数器gtidSetItem.NRow被错误增加, 导致cleanGtidExecuted提前执行
  • WaitForAllCommitted等待当前事务执行完毕, 最终锁死.
ghost pushed a commit that referenced this issue Feb 2, 2023
@re-f re-f added the big tx label Feb 6, 2023
@ghost ghost added this to the 4.22.12.0 milestone Apr 11, 2023
@ghost ghost closed this as completed Apr 11, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant