-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
MDEV-7394 : Making slave_skip_errors writable at runtime when slave is stopped #4634
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
Open
Mahmoud-kh1
wants to merge
1
commit into
MariaDB:main
Choose a base branch
from
Mahmoud-kh1:dynamic-slave-skip-error
base: main
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.
Open
Changes from all commits
Commits
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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,62 @@ | ||
| # MDEV-7394 test dynamic slave_skip_errors (writable when slaves stopped) | ||
| include/master-slave.inc | ||
| [connection master] | ||
| connection slave; | ||
| STOP SLAVE; | ||
| SET GLOBAL slave_skip_errors = "1062"; | ||
| START SLAVE; | ||
| SELECT @@global.slave_skip_errors; | ||
| @@global.slave_skip_errors | ||
| 1062 | ||
| connection master; | ||
| CREATE TABLE t1 (id INT PRIMARY KEY); | ||
| include/sync_slave_sql_with_master.inc | ||
| connection slave; | ||
| INSERT INTO t1 VALUES (2); | ||
| connection master; | ||
| INSERT INTO t1 VALUES (2); | ||
| include/sync_slave_sql_with_master.inc | ||
| connection slave; | ||
| include/check_slave_is_running.inc | ||
| START SLAVE; | ||
| Warnings: | ||
| Note 1254 Slave is already running | ||
| include/wait_for_slave_to_start.inc | ||
| SET GLOBAL slave_skip_errors = "1062"; | ||
| ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first | ||
| STOP SLAVE; | ||
| SET GLOBAL slave_skip_errors = "1050,1004,1104,1146"; | ||
| START SLAVE; | ||
| # erros should be showed in sorted order | ||
| SELECT @@global.slave_skip_errors; | ||
| @@global.slave_skip_errors | ||
| 1004,1050,1104,1146 | ||
| SET GLOBAL slave_ddl_exec_mode = STRICT; | ||
| # test that mulitiple errors are set correctly | ||
| connection slave; | ||
| include/stop_slave.inc | ||
| CREATE TABLE t2 (id INT); | ||
| include/start_slave.inc | ||
| connection master; | ||
| CREATE TABLE t2 (id INT); | ||
| INSERT INTO t1 VALUES (4); | ||
| connection slave; | ||
| connection slave; | ||
| include/check_slave_is_running.inc | ||
| connection master; | ||
| INSERT INTO t1 VALUES (3); | ||
| include/sync_slave_sql_with_master.inc | ||
| connection slave; | ||
| SELECT COUNT(*) FROM t1 WHERE id=3; | ||
| COUNT(*) | ||
| 1 | ||
| STOP SLAVE; | ||
| SET GLOBAL slave_skip_errors = "OFF"; | ||
| START SLAVE; | ||
| connection master; | ||
| DROP TABLE t1; | ||
| DROP TABLE t2; | ||
| include/sync_slave_sql_with_master.inc | ||
| connection slave; | ||
| SET GLOBAL slave_ddl_exec_mode = DEFAULT; | ||
| include/rpl_end.inc |
This file contains hidden or 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,69 @@ | ||
| --echo # MDEV-7394 test dynamic slave_skip_errors (writable when slaves stopped) | ||
|
|
||
| --source include/master-slave.inc | ||
| connection slave; | ||
| STOP SLAVE; | ||
| SET GLOBAL slave_skip_errors = "1062"; | ||
| START SLAVE; | ||
| SELECT @@global.slave_skip_errors; | ||
|
|
||
| connection master; | ||
| CREATE TABLE t1 (id INT PRIMARY KEY); | ||
| --source include/sync_slave_sql_with_master.inc | ||
|
|
||
| connection slave; | ||
| INSERT INTO t1 VALUES (2); | ||
|
|
||
| connection master; | ||
| INSERT INTO t1 VALUES (2); | ||
| --source include/sync_slave_sql_with_master.inc | ||
|
|
||
| connection slave; | ||
| source include/check_slave_is_running.inc; | ||
| START SLAVE; | ||
| --source include/wait_for_slave_to_start.inc | ||
| --error ER_SLAVE_MUST_STOP | ||
| SET GLOBAL slave_skip_errors = "1062"; | ||
|
|
||
| STOP SLAVE; | ||
| SET GLOBAL slave_skip_errors = "1050,1004,1104,1146"; | ||
| START SLAVE; | ||
|
|
||
| --echo # erros should be showed in sorted order | ||
| SELECT @@global.slave_skip_errors; | ||
|
|
||
| SET GLOBAL slave_ddl_exec_mode = STRICT; | ||
| --echo # test that mulitiple errors are set correctly | ||
|
|
||
| connection slave; | ||
| --source include/stop_slave.inc | ||
| CREATE TABLE t2 (id INT); | ||
| --source include/start_slave.inc | ||
|
|
||
| connection master; | ||
| CREATE TABLE t2 (id INT); | ||
| INSERT INTO t1 VALUES (4); | ||
| sync_slave_with_master; | ||
|
|
||
| connection slave; | ||
| source include/check_slave_is_running.inc; | ||
|
|
||
| connection master; | ||
| INSERT INTO t1 VALUES (3); | ||
| --source include/sync_slave_sql_with_master.inc | ||
|
|
||
| connection slave; | ||
| SELECT COUNT(*) FROM t1 WHERE id=3; | ||
|
|
||
| STOP SLAVE; | ||
| SET GLOBAL slave_skip_errors = "OFF"; | ||
| START SLAVE; | ||
|
|
||
| connection master; | ||
| DROP TABLE t1; | ||
| DROP TABLE t2; | ||
| --source include/sync_slave_sql_with_master.inc | ||
| connection slave; | ||
| SET GLOBAL slave_ddl_exec_mode = DEFAULT; | ||
|
|
||
| --source include/rpl_end.inc |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
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.
Is this testing an additional path? Or just a reset?
If its just a reset, omit.
Either way, put the last line
set GLOBAL slave_skip_errors = @my_slave_skip_errors;here as its relevant to this test.Could put the first
set @my_slave_skip_errors =@@global.slave_skip_errors;just prior to this test block.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.
no it's not reset , I am saving the initial values in the beginning of the test , and resting in the end, but I will move those this block of test as you suggested