github / gh-ost

GitHub's Online Schema-migration Tool for MySQL
MIT License
12.44k stars 1.26k forks source link

enable gh-ost checking the binlog format in real time (enhancement) #854

Open ruiaylin opened 4 years ago

ruiaylin commented 4 years ago

As we all know that if the binlog format was changed to statement or mixed on slave( where gh-ost get binlog from, master 's binlog is mixed) when gh-ost is running , some data maybe lose. In our company(Baidu.com), We want to avoid any risk of losing data when doing ddl on big tables. So we add binlog format checking logic to gh-ost.

The checking logic

We check every query event in the binlog stream , if the content in that event was a delete/insert/update/replace statement , we will issue an error and let gh-ost exit itself.

We want give the pr to gh-ost to make it more safety to do ddl

This is ours test

621ba57625238346791a5bed467e181b

Thanks

ruiaylin commented 4 years ago

We want make a pr to gh-ost