Status: Closed (View Workflow)
Affects Version/s: 0.8.3.Final
Fix Version/s: 0.9.0.Beta2
Steps to Reproduce:
1. create table `test` (id int, val varchar(20));
2. start dbz connector to sync for table test.
3. alter table `test` comment 'test1'/'test2' for N times.
4. restart the task.
5. insert into `test` VALUES(1, 'test')
The binlog event for insert will be skipped.
Binlog reader increased the count for restartEventsToSkip each time after it processed binlog event. That count would be reset when there is a 'BEGIN' sql or a 'COMMIT' sql. However, if the task was restarted after processing a DDL event, it would increase the restartEventsToSkip count as well as record the latest binlog position in offset, and the offset will be updated to kafka offset topic by the DDL record. And then, if the task was restarted, it will skip the first N events after restart which should not be skipped.