-
-
Notifications
You must be signed in to change notification settings - Fork 2k
MDEV-38497 Remove all slave related configurations on RESET SLAVE ALL #4641
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
deo002
wants to merge
1
commit into
MariaDB:12.3
Choose a base branch
from
deo002:fix/reset_slave_all
base: 12.3
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # | ||
| # MDEV-38497 RESET SLAVE ALL doesn't remove all slave related configurations | ||
| # | ||
| CHANGE MASTER TO | ||
| MASTER_HOST='localhost', | ||
| MASTER_USER='replssl', | ||
| MASTER_PASSWORD='password', | ||
| MASTER_PORT=3001, | ||
| MASTER_CONNECT_RETRY=7, | ||
| MASTER_HEARTBEAT_PERIOD=3, | ||
| MASTER_SSL=1, | ||
| MASTER_SSL_CA='MYSQL_TEST_DIR/std_data/cacert.pem', | ||
| MASTER_SSL_CAPATH='MYSQL_TEST_DIR/std_data', | ||
| MASTER_SSL_CERT='MYSQL_TEST_DIR/std_data/client-cert.pem', | ||
| MASTER_SSL_KEY='MYSQL_TEST_DIR/std_data/client-key.pem', | ||
| MASTER_SSL_CRL='MYSQL_TEST_DIR/std_data/crl.pem', | ||
| MASTER_SSL_CRLPATH='MYSQL_TEST_DIR/std_data', | ||
| MASTER_SSL_CIPHER='AES256-SHA', | ||
| MASTER_SSL_VERIFY_SERVER_CERT=1, | ||
| MASTER_RETRY_COUNT=17, | ||
| MASTER_USE_GTID=current_pos, | ||
| IGNORE_SERVER_IDS=(123), | ||
| DO_DOMAIN_IDS=(19); | ||
| RESET SLAVE ALL; | ||
| Warnings: | ||
| Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' | ||
| CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root'; | ||
| SHOW SLAVE STATUS; | ||
| Slave_IO_State | ||
| Master_Host 127.0.0.1 | ||
| Master_User root | ||
| Master_Port 3306 | ||
| Connect_Retry 60 | ||
| Master_Log_File | ||
| Read_Master_Log_Pos 4 | ||
| Relay_Log_File mysqld-relay-bin.000001 | ||
| Relay_Log_Pos 4 | ||
| Relay_Master_Log_File | ||
| Slave_IO_Running No | ||
| Slave_SQL_Running No | ||
| Replicate_Do_DB | ||
| Replicate_Ignore_DB | ||
| Replicate_Do_Table | ||
| Replicate_Ignore_Table | ||
| Replicate_Wild_Do_Table | ||
| Replicate_Wild_Ignore_Table | ||
| Last_Errno 0 | ||
| Last_Error | ||
| Skip_Counter 0 | ||
| Exec_Master_Log_Pos 0 | ||
| Relay_Log_Space 257 | ||
| Until_Condition None | ||
| Until_Log_File | ||
| Until_Log_Pos 0 | ||
| Master_SSL_Allowed Yes | ||
| Master_SSL_CA_File | ||
| Master_SSL_CA_Path | ||
| Master_SSL_Cert | ||
| Master_SSL_Cipher | ||
| Master_SSL_Key | ||
| Seconds_Behind_Master NULL | ||
| Master_SSL_Verify_Server_Cert No | ||
| Last_IO_Errno 0 | ||
| Last_IO_Error | ||
| Last_SQL_Errno 0 | ||
| Last_SQL_Error | ||
| Replicate_Ignore_Server_Ids | ||
| Master_Server_Id 0 | ||
| Master_SSL_Crl | ||
| Master_SSL_Crlpath | ||
| Using_Gtid Slave_Pos | ||
| Gtid_IO_Pos | ||
| Replicate_Do_Domain_Ids | ||
| Replicate_Ignore_Domain_Ids | ||
| Parallel_Mode optimistic | ||
| SQL_Delay 0 | ||
| SQL_Remaining_Delay NULL | ||
| Slave_SQL_Running_State | ||
| Slave_DDL_Groups 0 | ||
| Slave_Non_Transactional_Groups 0 | ||
| Slave_Transactional_Groups 0 | ||
| Replicate_Rewrite_DB | ||
| Connects_Tried 0 | ||
| Master_Retry_Count 100000 | ||
| RESET SLAVE ALL; | ||
| # End of reset_slave_all_leaks_master_info.test |
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,43 @@ | ||
| --source include/not_embedded.inc | ||
|
|
||
| --echo # | ||
gkodinov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| --echo # MDEV-38497 RESET SLAVE ALL doesn't remove all slave related configurations | ||
| --echo # | ||
|
|
||
| # Test replica should clear ALL master connection info | ||
|
|
||
| --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR | ||
| eval CHANGE MASTER TO | ||
| MASTER_HOST='localhost', | ||
| MASTER_USER='replssl', | ||
| MASTER_PASSWORD='password', | ||
| MASTER_PORT=3001, | ||
| MASTER_CONNECT_RETRY=7, | ||
| MASTER_HEARTBEAT_PERIOD=3, | ||
| MASTER_SSL=1, | ||
| MASTER_SSL_CA='$MYSQL_TEST_DIR/std_data/cacert.pem', | ||
| MASTER_SSL_CAPATH='$MYSQL_TEST_DIR/std_data', | ||
| MASTER_SSL_CERT='$MYSQL_TEST_DIR/std_data/client-cert.pem', | ||
| MASTER_SSL_KEY='$MYSQL_TEST_DIR/std_data/client-key.pem', | ||
| MASTER_SSL_CRL='$MYSQL_TEST_DIR/std_data/crl.pem', | ||
| MASTER_SSL_CRLPATH='$MYSQL_TEST_DIR/std_data', | ||
| MASTER_SSL_CIPHER='AES256-SHA', | ||
| MASTER_SSL_VERIFY_SERVER_CERT=1, | ||
| MASTER_RETRY_COUNT=17, | ||
| MASTER_USE_GTID=current_pos, | ||
| IGNORE_SERVER_IDS=(123), | ||
| DO_DOMAIN_IDS=(19); | ||
|
|
||
| # | ||
| # Everything must be cleared / set to default values | ||
| # | ||
| RESET SLAVE ALL; | ||
|
|
||
| CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root'; | ||
|
|
||
| --query_vertical SHOW SLAVE STATUS | ||
|
|
||
| # Cleanup | ||
| RESET SLAVE ALL; | ||
|
|
||
| --echo # End of reset_slave_all_leaks_master_info.test | ||
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 |
|---|---|---|
|
|
@@ -28,6 +28,12 @@ | |
|
|
||
| static void init_master_log_pos(Master_info* mi); | ||
|
|
||
| static void init_ssl_config(Master_info* mi); | ||
|
|
||
| static void init_connection_config(Master_info* mi); | ||
|
|
||
| static void init_group_counters(Master_info* mi); | ||
|
|
||
| Master_info::Master_info(LEX_CSTRING *connection_name_arg, | ||
| bool is_slave_recovery): | ||
| Master_info_file(ignore_server_ids, domain_id_filter.m_domain_ids[0], | ||
|
|
@@ -177,9 +183,47 @@ void Master_info::clear_in_memory_info(bool all) | |
| host[0] = 0; user[0] = 0; password[0] = 0; | ||
| domain_id_filter.clear_ids(); | ||
| reset_dynamic(&ignore_server_ids); | ||
| init_ssl_config(this); | ||
| init_connection_config(this); | ||
| init_group_counters(this); | ||
| } | ||
| } | ||
|
|
||
|
|
||
| void init_ssl_config(Master_info* mi) | ||
| { | ||
| DBUG_ENTER("init_ssl_config"); | ||
| mi->master_ssl= 1; | ||
| mi->master_ssl_verify_server_cert= 0; | ||
| mi->master_ssl_ca= nullptr; mi->master_ssl_capath= nullptr; mi->master_ssl_cert= nullptr; | ||
| mi->master_ssl_cipher= nullptr; mi->master_ssl_key= nullptr; mi->master_ssl_crl= nullptr; | ||
| mi->master_ssl_crlpath= nullptr; | ||
|
Comment on lines
+198
to
+200
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should fix the earlier LTS versions as well. In either case, this section is unique to a refactor on 12.3. |
||
| DBUG_VOID_RETURN; | ||
| } | ||
|
|
||
|
|
||
| void init_group_counters(Master_info* mi) | ||
| { | ||
| DBUG_ENTER("init_group_counters"); | ||
| mi->total_ddl_groups= 0; | ||
| mi->total_non_trans_groups= 0; | ||
| mi->total_trans_groups= 0; | ||
| DBUG_VOID_RETURN; | ||
| } | ||
|
|
||
|
|
||
| void init_connection_config(Master_info* mi) | ||
| { | ||
| DBUG_ENTER("init_connection_config"); | ||
| mi->connect_retry.set_default(); | ||
| mi->retry_count.set_default(); | ||
| mi->master_id= 0; | ||
| mi->prev_master_id= 0; | ||
| mi->received_heartbeats= 0; | ||
| DBUG_VOID_RETURN; | ||
| } | ||
|
|
||
|
|
||
| void init_master_log_pos(Master_info* mi) | ||
| { | ||
| DBUG_ENTER("init_master_log_pos"); | ||
|
|
||
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.
I thought I saw RESET SLAVE already tested somewhere.
Maybe it didn’t cover RESET SLAVE ALL well.