-
Notifications
You must be signed in to change notification settings - Fork 713
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug#26336636 USE STD::ATOMIC RATHER THAN VOLATILE WHEN INSPECTING STA…
…TUS OF OTHER THREADS Summary: Backport Bug#26336636 USE STD::ATOMIC RATHER THAN VOLATILE WHEN INSPECTING STATUS OF OTHER THREADS to make THD::killed thread safe Also include changes to MyRocks that check the killed state. Binlog commit is modified to check the kill flag without checking shutdown_in_progress, which is not atomic. Also add new testcase to test semisync shutdown disconnect path. Porting notes: when porting to 8.0.22+ the changes for MyRocks and test cases should be kept. Reviewed By: yizhang82 Differential Revision: D25773954 fbshipit-source-id: 722a5262b62
- Loading branch information
1 parent
c9e81d9
commit 72c6314
Showing
17 changed files
with
119 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
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; | ||
call mtr.add_suppression("SEMISYNC: Forced shutdown. Some updates might not be replicated."); | ||
CREATE TABLE t1 (a INT) ENGINE = INNODB; | ||
INSERT INTO t1 VALUES (1), (2); | ||
[ enable semi-sync on master ] | ||
set global rpl_semi_sync_master_timeout= 600000 /* 600s */; | ||
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 | ||
Should wait for semisync ack | ||
INSERT INTO t1 VALUES (3); | ||
Checking for thread to wait | ||
Shutting down the server | ||
ERROR HY000: Lost connection to MySQL server during query | ||
# | ||
# Clean up | ||
# | ||
# restart the server | ||
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 |
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,56 @@ | ||
source include/have_semisync.inc; | ||
source include/not_embedded.inc; | ||
source include/have_innodb.inc; | ||
source include/have_log_bin.inc; | ||
|
||
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; | ||
|
||
call mtr.add_suppression("SEMISYNC: Forced shutdown. Some updates might not be replicated."); | ||
CREATE TABLE t1 (a INT) ENGINE = INNODB; | ||
INSERT INTO t1 VALUES (1), (2); | ||
|
||
echo [ enable semi-sync on master ]; | ||
set global rpl_semi_sync_master_timeout= 600000 /* 600s */; | ||
set global rpl_semi_sync_master_enabled = 1; | ||
show variables like 'rpl_semi_sync_master_enabled'; | ||
|
||
echo [ status of semi-sync on master should be ON even without any semi-sync slaves ]; | ||
show status like 'Rpl_semi_sync_master_clients'; | ||
show status like 'Rpl_semi_sync_master_status'; | ||
show status like 'Rpl_semi_sync_master_yes_tx'; | ||
|
||
connect (con1,localhost,root,,); | ||
connection con1; | ||
--echo Should wait for semisync ack | ||
--send INSERT INTO t1 VALUES (3) | ||
|
||
connection default; | ||
--echo Checking for thread to wait | ||
let $wait_condition= | ||
select count(*)>0 from information_schema.processlist where state='Waiting for semi-sync ACK from slave'; | ||
source include/wait_condition.inc; | ||
|
||
--echo Shutting down the server | ||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect | ||
--exec $MYSQL -e "shutdown;" 2>&1 | ||
--source include/wait_until_disconnected.inc | ||
|
||
connection con1; | ||
--error 2013 | ||
--reap | ||
disconnect con1; | ||
|
||
--echo # | ||
--echo # Clean up | ||
--echo # | ||
|
||
connection default; | ||
|
||
--echo # restart the server | ||
--exec echo "restart:" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect | ||
--enable_reconnect | ||
--source include/wait_until_connected_again.inc | ||
|
||
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
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
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
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