You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
wxl356
changed the title
如果--stop-pos和MySQL最新position一样,且MySQL binlog没有更新,会导致bingo2sql无法正常结束
如果--stop-pos和MySQL最新position一样,且MySQL binlog只有DDL、没有其他更新,会导致bingo2sql无法正常结束
Oct 17, 2023
如何复现:
1 flush logs生成新的binlog,该binlog只执行DDL,show master status; 得到binlog file和position
flush logs;
create table t2(id int);
show master status; -- | mysql-bin.004720 | 402 |
---后续不再执行其他SQL、binlog保持不变。
2 bingo2sql解析时,--stop-file --stop-pos使用第一步获取的binlog file和position。由于MySQL binlog 一直没有更新,bingo2sql将无法结束,需要Ctrl+C kill:
./bingo2sql -h=xxx -P 3306 -uxxx -p'xxx' -d monitor --start-file="mysql-bin.004720" --start-pos=4 --stop-file="mysql-bin.004720" --stop-pos=402 -B
[2023/10/17 07:00:08] [info] binlogsyncer.go:392 begin to sync binlog from position (mysql-bin.004720, 4)
[2023/10/17 07:00:08] [info] binlogsyncer.go:808 rotate to (mysql-bin.004720, 4)
INFO[2023-10-17T07:00:08Z] 超出最新binlog位置 file=parser.go line=571 当前位置=402 当前文件=mysql-bin.004720 结束位置=402 结束文件=mysql-bin.004720
原因:
checkFinish(https://github.com/hanchuanchuan/bingo2sql/blob/master/core/parser.go#L523) 和finishFlag(https://github.com/hanchuanchuan/bingo2sql/blob/master/core/parser.go#L2271) 可能需要对只有DDL的场景做处理?
The text was updated successfully, but these errors were encountered: