MDEV-38497 Remove all slave related configurations on RESET SLAVE ALL#4641
MDEV-38497 Remove all slave related configurations on RESET SLAVE ALL#4641deo002 wants to merge 1 commit intoMariaDB:12.3from
Conversation
ce7d020 to
3bbf843
Compare
ParadoxV5
left a comment
There was a problem hiding this comment.
Hello~ Thanks for taking this on. Here’s some early feedback before I go on break.
| 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; |
There was a problem hiding this comment.
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.
sql/rpl_mi.cc
Outdated
| init_ssl_config(this); | ||
| init_connection_config(this); | ||
| init_group_counters_config(this); |
There was a problem hiding this comment.
The project isn’t just about adding clears to RESET SLAVE, but also checking which one is done where and whether they could’ve been the same.
There was a problem hiding this comment.
I have checked it and added tests accordingly. I'll verify it once again.
There was a problem hiding this comment.
I thought I saw RESET SLAVE already tested somewhere.
Maybe it didn’t cover RESET SLAVE ALL well.
| # Cleanup | ||
| RESET REPLICA ALL; | ||
|
|
||
| # --source include/rpl_end.inc |
There was a problem hiding this comment.
- Please use
SLAVEoverREPLICAto match the other tests for the time being. - Perhaps the second RESET is for clearing the
MASTER_HOST='localhost'part.
But MTR is okay if you leave certain configurations set to their defaults. - Interesting that the CI kept working with
rpl_end.inccommented out.
Well, at least until thisrpl.rpl_slave_statusyou reported on Zulip.
There was a problem hiding this comment.
I checked it! The rpl.rpl_slave_status was failing due to a faulty code change. I had set mi->retry_count TO 0, which made the replica try to establish a connection infinitely, causing a timeout.
713d688 to
30c79d9
Compare
a446da1 to
e1df985
Compare
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for your contribution. This is a preliminary review.
Please update the commit message and the text to say exactly what gets reset.
Also, please fix the failing tests in build-bot.
e1df985 to
55c1bba
Compare
gkodinov
left a comment
There was a problem hiding this comment.
LGTM. Thank you for working on this with me! Please stand by for the final review.
And yes, the test failure is indeed unrelated. I've re-run the failing host now.
Always a pleasure @gkodinov ! |
55c1bba to
0f7dbc6
Compare
Fix RESET SLAVE ALL to fully clear replica configuration of the default unnamed slave, including SSL options, connection config, logging info and group info so subsequent CHANGE MASTER starts from a clean state. Signed-off-by: Dearsh Oberoi <oberoidearsh@gmail.com>
0f7dbc6 to
4e254df
Compare
Description
RESET SLAVE ALL on the default unnamed slave does not all clear of its configurations from the server. So, certain configurations get carried onto the subsequent CHANGE MASTER.
This PR fixes it with a proper clean up of all the config options.
Class variables and their reset status:
user, password, host: Set inCHANGE MASTERand must be reset inRESET SLAVEcommand.master_log_file, master_log_pos: Set inCHANGE MASTER.master_log_filecan also be set using server init options. Must be reset inRESET SLAVEcommand.ssl config options: Set inCHANGE MASTERand must be reset inRESET SLAVE ALLcommand.rpl_filter: Set using server init options ex.replicate_do_db, replicate_ignore_dbetc. Should not be reset inRESET SLAVEas it is server level configuration.domain_id_filter - IGNORE_DOMAIN_IDS, DO_DOMAIN_IDS: Set inCHANGE MASTER. Should be reset inRESET SLAVE ALL.rli: Stores info about the replication thread. Initialization handled by thehandle_slave_sql, the slave sql thread entry point. Relevant things are reinitialized in thereset_slave, get_master_version_and_clockfunctions. No need to add something in this PR.checksum_alg_before_fd: to hold checksum alg in use until IO thread has received FD. No need to be touched inRESET SLAVE.master_connect_retry: Set inCHANGE MASTER. Needs to be setback to default value inRESET SLAVE ALL.master_retry_count: Set inCHANGE MASTER. Needs to be setback to default value inRESET SLAVE ALL. Setting it to 0 will make the slave try infinitely to connect to master resulting in timeout errors in some tests.connects_tried: Set to 0 inreset_slavefunction. No need to add something in this PR.binlog_storage_engine: Set using server init option--binlog-storage-engineof the master inget_master_version_and_clock. Nothing to be done inRESET SLAVE.inited, abort_slave, slave_running, slave_run_id: Set to know the slave lifecycle state. Nothing to be done inRESET SLAVE ALL.clock_diff_with_master: Clock diff with master. Not to be touched inRESET SLAVEmaster_id: Set inget_master_version_and_clockon server connect. Needs to be reset inRESET SLAVE ALL.prev_master_id: Set in rotate log event. Needs to be reset inRESET SLAVE ALL.sync_counter: Set using server init option--sync-master-info. Not to be touched inRESET SLAVE ALL.recieved_heartbeats: Incremented during aHEARTBEAT_LOG_EVENTevent. It is reset inCHANGE MASTERbut also should be reset inRESET SLAVE ALL.ignore_server_ids: Set inCHANGE MASTER. Needs to be reset inRESET SLAVE ALL.master_use_gtid: Set inCHANGE MASTER. Needs to be reset to default value inRESET SLAVE ALL.gtid_current_pos: Used when connecting to a master server with GTID. Set tolast_queued_gtidwhen the entire gtid event is queued without issues. Needs to be reset inRESET SLAVE ALL.events_queued_since_last_gtid: Set to 0 onSTART SLAVE, on recieving a rotate event and when gtid event is queued without issues. AsSTART SLAVEresets it, we don't need to reset it inRESET SLAVE ALL. But it was in code previously, so not touching it.last_queued_gtid, last_queued_gtid_standalone: Set during logging a GTID_EVENT. It is not cleared anywhere, it should be though, inSTART SLAVE.RESET SLAVE ALLdoesn't seem to be a appropriate place for it.gtid_reconnect_event_skip_count: Set toevents_queued_since_last_gtidwhen a slave io thread reconnects and to 0 inSTART SLAVE. AsSTART SLAVEresets it, we don't need to reset it inRESET SLAVE ALL. But it was in code previously, so not touching it.gtid_event_seen: Set to true when a GTID_EVENT occurs. Set to false when slave io thread reconnects via gtid to master.RESET SLAVE ALLdoesn't seem to be a appropriate place for it. But it was in code previously, so not touching it.rows_event_tracker: Reset when a slave io thread starts. No need to reset it inRESET SLAVE ALL.in_start_all_slaves, in_stop_all_slaves, in_flush_all_relay_logs, users, killed: Used for operations on the master info index. Not to be reset inRESET SLAVE.total_ddl_groups, total_non_trans_groups, total_trans_groups: Set when a gtid event is read from the relay log. Needs to be cleaned up inRESET SLAVE ALL. These values are also shown inSHOW SLAVE STATUS.parallel_mode: Set via server init option--slave-parallel-mode. No need to be reset inRESET SLAVE.semi_ack: Set after parsing the semi-sync packet header when slave io thread is started. No need to be reset inRESET SLAVE.do_accept_own_server_id: Initialized when the slave io thread is started. Computed when a gtid event is recieved. No need to be reset inRESET SLAVE.semi_sync_reply_enabled: Not to be reset inRESET SLAVE.Basing the PR against the correct MariaDB version
mainbranch.PR quality check