MySQL:半同步(三)从库端初始化和回调函数

作者简介:高鹏,笔名八怪。《深入理解MySQL主从原理》图书作者,同时运营个人公众号“MySQL学习”,持续分享遇到的有趣case以及代码解析!

源码版本5.7.29

一、全局变量

semisync_slave_plugin.cc

ReplSemiSyncSlave repl_semisync; /*   indicate whether or not the slave should send a reply to the master.        This is set to true in repl_semi_slave_read_event if the current     event read is the last event of a transaction. And the value is     checked in repl_semi_slave_queue_event. */ bool semi_sync_need_reply= false;