-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create rpl_master_retry_count.test
#3731
Draft
ParadoxV5
wants to merge
2
commits into
10.5
Choose a base branch
from
px5.rpl_master_retry_count
base: 10.5
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
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,11 @@ | ||
!include include/default_mysqld.cnf | ||
!include include/default_client.cnf | ||
|
||
[mysqld.2] | ||
master-retry-count = 2 | ||
|
||
[mysqld.3] | ||
master-retry-count = 1 | ||
|
||
[mysqld.4] | ||
master-retry-count = 0 |
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,88 @@ | ||
# This test is based on `rpl_get_master_version_and_clock`. | ||
DISABLE_QUERY_LOG; | ||
|
||
SOURCE include/have_debug.inc; | ||
SOURCE include/have_debug_sync.inc; | ||
SOURCE include/have_log_bin.inc; # The test is agnostic of binlog formats. | ||
LET $rpl_topology= 1->2, 1->3, 1->4; | ||
SOURCE include/rpl_init.inc; | ||
|
||
# '2013' CR_SERVER_LOST | ||
# '2003' CR_CONN_HOST_ERROR | ||
# '2002' CR_CONNECTION_ERROR | ||
# '2006' CR_SERVER_GONE_ERROR | ||
# '1053' ER_SERVER_SHUTDOWN | ||
LET $slave_io_errno= 1053, 2002, 2003, 2006, 2013; | ||
LET $status_items= Slave_IO_Running; | ||
LET $slave_param= $status_items; | ||
LET $slave_param_value= Yes; | ||
|
||
#CALL mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: .*"); | ||
#CALL mtr.add_suppression("Slave I/O: .* failed with error: Lost connection to MySQL server at 'reading initial communication packet'"); | ||
#CALL mtr.add_suppression("Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; .*"); | ||
#CALL mtr.add_suppression("Slave I/O thread .* register on master"); | ||
|
||
DELIMITER // | ||
FOR i IN 2..4 DO | ||
LET $rpl_connection_name= server_`i`; | ||
SOURCE include/rpl_connection.inc; | ||
SOURCE include/stop_slave.inc; | ||
END FOR; | ||
// | ||
|
||
FOR i IN 2..4 DO | ||
LET $rpl_connection_name= server_`i`; | ||
SOURCE include/rpl_connection.inc; | ||
SET master_connect_retry= (i-1) % 3; # 1, 2, 0 | ||
|
||
ECHO Case 1: Retry for reconnecting from a simulated disconnection; | ||
# This section is based on include/rpl_get_master_version_and_clock.test | ||
|
||
SET original_dbug = @@GLOBAL.debug_dbug; | ||
SET @@GLOBAL.debug_dbug= "d,debug_lock.before_get_UNIX_TIMESTAMP"; | ||
CHANGE PRIMARY TO master_connect_retry= master_connect_retry; | ||
SOURCE include/start_slave.inc; | ||
# The replica will hang in `get_master_version_and_clock`. | ||
|
||
LET $rpl_server_number= 1; | ||
SOURCE include/rpl_stop_server.inc; # shut the primary down | ||
SET DEBUG_SYNC= "now SIGNAL signal.get_unix_timestamp"; | ||
LET $rpl_connection_name= server_`i`; | ||
SOURCE include/rpl_connection.inc; | ||
SET @@GLOBAL.debug_dbug= original_dbug; | ||
|
||
LET $slave_io_error_is_nonfatal= 1; | ||
SOURCE include/wait_for_slave_io_error.inc; | ||
SOURCE include/show_slave_status.inc; | ||
SLEEP 2.5; # sleep until master_retry_count*master_connect_retry exhausts | ||
SOURCE include/show_slave_status.inc; | ||
|
||
ECHO Case 2: Retry for a failed simulated new connection; | ||
|
||
LET $slave_name= master_retry_count; | ||
CHANGE PRIMARY $slave_name TO master_connect_retry= master_connect_retry; | ||
SOURCE include/start_slave.inc; | ||
START REPLICA $slave_name; # `start_slave.inc` only expects success | ||
|
||
LET $slave_io_error_is_nonfatal= 1; | ||
SOURCE include/wait_for_slave_io_error.inc; | ||
SOURCE include/show_slave_status.inc; | ||
SLEEP 2.5; # ditto | ||
SOURCE include/show_slave_status.inc; | ||
|
||
# Cleanup | ||
LET $rpl_server_number= 1; | ||
SOURCE include/rpl_start_server.inc; | ||
LET $rpl_connection_name= server_`i`; | ||
SOURCE include/rpl_connection.inc; | ||
RESET REPLICA $slave_name; | ||
# `wait_for_slave_io_to_start.inc` fails if the IO thread has an error. | ||
START REPLICA; | ||
SOURCE include/wait_for_slave_param.inc; | ||
END FOR; | ||
// | ||
DELIMITER ; | ||
|
||
#SET DEBUG_SYNC= 'RESET'; | ||
SOURCE include/rpl_end.inc; | ||
ENABLE_QUERY_LOG; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(this thing’s definitely not on)
Also, I forgot to reset this
master_connect_retry
at the end.