rust_mysql_common icon indicating copy to clipboard operation
rust_mysql_common copied to clipboard

Defining mysql replication Heartbeet Event period from the secondary

Open darnuria opened this issue 2 years ago • 1 comments

Hey,

For the work I implemented defining the Heartbeet frequency from the client.

I don't know if it's something that is worth implementing here but it's technically possible (and already in production).

It's done this way in pymysql replication :

https://github.com/julien-duponchelle/python-mysql-replication/blob/main/pymysqlreplication/binlogstream.py#L364-L377

I did it in Rust for day-job and worked fine. (Will edit on day-job time to share the snippet but it's weekend now! ;))

Mysql code: https://github.com/mysql/mysql-server/blob/87307d4ddd88405117e3f1e51323836d57ab1f57/sql/rpl_binlog_sender.cc#L847-L857

But on mysql 5.7 percona the modified setting didn't shown up with tools to check session variables like heart_beat_period.

Didn't tested if it's correctly updated on 8.0.

Feel free to close if it's outside the scope of the lib or should be moved to network-impl crates. :)

darnuria avatar Nov 11 '23 08:11 darnuria

Update it look like this worked with percona8 with it's docker image

darnuria avatar Feb 15 '24 20:02 darnuria