Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add semisync functionality to mysqlbinlog
Summary: WebScaleSQL Feature: Semisync Log Tailers Share the semisync_slave plugin code to use for semisync functionality in mysqlbinlog. mysqlbinlog sends acknowledgement for events which require a semi sync reply. Since mysqlbinlog now speaks semi-sync portocol, we force the semi-sync plugin to be built regardless of the option WITHOUT_SERVER. Test Plan: mysqlbinlog with and without --semisync-debug mtr test to verify mysqlbinlog slave is acknowledging for events it received. This has been used in production at Facebook for > 9 months. Reviewers: darnaut, inaam-rana, pivanof, jeremycole Reviewed By: pivanof, jeremycole Subscribers: steaphan, jtolmer, CalvinSun Differential Revision: https://reviews.facebook.net/D24171 Differential Revision: https://reviews.facebook.net/D32763
- Loading branch information
1 parent
e7311f7
commit 60930e2
Showing
15 changed files
with
371 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| set @save_master_timeout=@@global.rpl_semi_sync_master_timeout; | ||
| set @save_master_wait_no_slave=@@global.rpl_semi_sync_master_wait_no_slave; | ||
| set @save_master_enabled=@@global.rpl_semi_sync_master_enabled; | ||
| [ enable semi-sync on master ] | ||
| set global rpl_semi_sync_master_timeout= 60000 /* 60s */; | ||
| set global rpl_semi_sync_master_enabled = 1; | ||
| show variables like 'rpl_semi_sync_master_enabled'; | ||
| Variable_name Value | ||
| rpl_semi_sync_master_enabled ON | ||
| [ status of semi-sync on master should be ON even without any semi-sync slaves ] | ||
| show status like 'Rpl_semi_sync_master_clients'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_clients 0 | ||
| show status like 'Rpl_semi_sync_master_status'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_status ON | ||
| show status like 'Rpl_semi_sync_master_yes_tx'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_yes_tx 0 | ||
| [ initial master state after the semi-sync mysqlbinlog connected ] | ||
| show status like 'Rpl_semi_sync_master_clients'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_clients 1 | ||
| show status like 'Rpl_semi_sync_master_status'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_status ON | ||
| show status like 'Rpl_semi_sync_master_no_tx'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_no_tx 0 | ||
| show status like 'Rpl_semi_sync_master_yes_tx'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_yes_tx 0 | ||
| create table t1(a int) engine = Innodb; | ||
| [ master state after CREATE TABLE statement ] | ||
| show status like 'Rpl_semi_sync_master_status'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_status ON | ||
| show status like 'Rpl_semi_sync_master_no_tx'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_no_tx 0 | ||
| show status like 'Rpl_semi_sync_master_yes_tx'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_yes_tx 1 | ||
| [ insert records to table ] | ||
| [ master status after inserts ] | ||
| show status like 'Rpl_semi_sync_master_status'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_status ON | ||
| show status like 'Rpl_semi_sync_master_no_tx'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_no_tx 0 | ||
| show status like 'Rpl_semi_sync_master_yes_tx'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_yes_tx 11 | ||
| set global rpl_semi_sync_master_wait_no_slave = OFF; | ||
| show variables like 'rpl_semi_sync_master_wait_no_slave'; | ||
| Variable_name Value | ||
| rpl_semi_sync_master_wait_no_slave OFF | ||
| show variables like 'rpl_semi_sync_master_enabled'; | ||
| Variable_name Value | ||
| rpl_semi_sync_master_enabled ON | ||
| show status like 'Rpl_semi_sync_master_status'; | ||
| Variable_name Value | ||
| Rpl_semi_sync_master_status ON | ||
| # | ||
| # Clean up | ||
| # | ||
| set @@global.rpl_semi_sync_master_timeout=@save_master_timeout; | ||
| set @@global.rpl_semi_sync_master_wait_no_slave=@save_master_wait_no_slave; | ||
| set @@global.rpl_semi_sync_master_enabled=@save_master_enabled; | ||
| drop table t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| $SEMISYNC_PLUGIN_OPT | ||
| --force-restart |
Oops, something went wrong.