-
Bug
-
Resolution: Done
-
Blocker
-
2.4.1.Final
-
None
-
False
-
None
-
False
-
Critical
In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.
Bug report
For bug reports, provide this information, please:
What Debezium connector do you use and what version?
Embedded Debezium 2.4.1-Final
What is the connector configuration?
MySql connector
What is the captured database version and mode of deployment?
(E.g. on-premises, with a specific cloud provider, etc.)
On-premises Mysql
What behavior do you expect?
BinaryLogClient's Keep-Alive thread should restart the binlog polling thread to resume from the correct offset that was updated/saved.
What behavior do you see?
When there is a disconnect and binary log client's keep-alive thread detects it, it resumes from the gtidset that was from the time when connector was successfully started. This may potentially be several days old and lead to data corruption until all events get replayed.
Do you see the same behaviour using the latest released Debezium version?
(Ideally, also verify with latest Alpha/Beta/CR version)
We're using 2.4.1 but it may exist in all versions if the underlying binlog client library is not updated.
Do you have the connector logs, ideally from start till finish?
(You might be asked later to provide DEBUG/TRACE level log)
How to reproduce the issue using our tutorial deployment?
To reproduce this issue, we used proxysql that proxies the connections to read-only replicas. When the dns of the read-only replica is updated and the db replica that had a connection from debezium is shutdown, keep-alive thread detects the disconnection and spawns a new thread that continues to poll the binlog. Unfortunately, the offset is incorrect at this point of time.
Feature request or enhancement
For feature requests or enhancements, provide this information, please:
Which use case/requirement will be addressed by the proposed feature?
The issue is a potential bug so it needs to be addressed for any polling functionality of mysql.
Implementation ideas (optional)
Make the BinaryLogClient thread-safe as discussed in the thread. Pls find more details on https://debezium.zulipchat.com/#narrow/stream/348104-community-mysql-mariadb/topic/Incremental.20snapshots.20leads.20to.20streaming.201.20day.20older.20data/near/466873885