MDEV-37842 Skip implicit Using_Gtid warning when value is unchanged#4678
Open
bodyhedia44 wants to merge 1 commit intoMariaDB:10.11from
Open
MDEV-37842 Skip implicit Using_Gtid warning when value is unchanged#4678bodyhedia44 wants to merge 1 commit intoMariaDB:10.11from
bodyhedia44 wants to merge 1 commit intoMariaDB:10.11from
Conversation
When CHANGE MASTER TO is issued with log coordinates (e.g. relay_log_pos) and master_use_gtid is not explicitly specified, the code implicitly sets Using_Gtid to No and emits a warning. However, if Using_Gtid is already No, the warning incorrectly reports changing from 'No' to 'No'. Add a check that the current Using_Gtid value differs from USE_GTID_NO before emitting the implicit change warning.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
MDEV-37842 Skip implicit Using_Gtid warning when value is unchanged
Description
When a replica already has
Using_Gtid=Noand aCHANGE MASTER TOis issued with log coordinates (e.g.relay_log_pos,master_log_file), the server emits a spurious warning:Note 4190: CHANGE MASTER TO is implicitly changing the value of 'Using_Gtid' from 'No' to 'No'
The value isn't actually changing, so the warning is misleading.
Root Cause
In
change_master()(sql/sql_repl.cc), when log coordinates are specified without an explicitmaster_use_gtid, the code implicitly setsUsing_GtidtoNoand emits a warning. The condition only checks whethermaster_use_gtid=Nowas explicitly given — it does not check whetherUsing_Gtidis alreadyNo. This causes the "from No to No" warning.Fix
Added a check that the current
Using_Gtidvalue differs fromUSE_GTID_NObefore emitting the warning. The warning now only fires when the value actually changes.How to test
Start a MariaDB 10.11+ server and connect as a client:
Expected: Note 4190: CHANGE MASTER TO is implicitly changing the value of 'Using_Gtid' from 'Slave_Pos' to 'No'