osheroff / mysql-binlog-connector-java

MySQL Binary Log connector
641 stars 161 forks source link

mysql long transaction will restart infinitely, no longer consume binlog #112

Open someorz opened 1 year ago

someorz commented 1 year ago

When I use flinkcdc, I found that if a large amount of data is inserted in a transaction, the BinaryLogClient will be disconnected, and it will be disconnected immediately after reconnecting. I think the bottom layer is using this library, may I ask what may be the reason for this situation?

someorz commented 1 year ago

mysql master log

2023-05-10T08:12:04.412709+08:00 89792184 [Note] Start binlog_dump to master_thread_id(89792184) slave_server(5601), pos(./mysql-bin.240254, 4) with GTID 2023-05-10T08:12:04.412728+08:00 89792184 [Note] Start asynchronous binlog_dump to slave (server_id: 5601), pos(./mysql-bin.240254, 4) binlog end pos(mysql-bin.240255, 120388992) 2023-05-10T08:12:05.004265+08:00 89792184 [Note] Stop asynchronous binlog_dump to slave (server_id: 5601) 2023-05-10T08:12:05.004320+08:00 89792184 [Note] Aborted connection 89792184 to db: 'unconnected' user: '' host: '10.60.238.66' (Failed on my_net_write())

someorz commented 9 months ago

image I guess the problem is caused by this piece of code. When a particularly large transaction occurs, it will cause a timeout, then the connection will be disconnected, reconnected, and then continue to receive the large transaction, timeout, and then reconnect. Loop endlessly