Skip to content
/ server Public

Comments

MDEV-37842 Skip implicit Using_Gtid warning when value is unchanged#4678

Open
bodyhedia44 wants to merge 1 commit intoMariaDB:10.11from
bodyhedia44:MDEV-37842-fix-implicit-gtid-warning
Open

MDEV-37842 Skip implicit Using_Gtid warning when value is unchanged#4678
bodyhedia44 wants to merge 1 commit intoMariaDB:10.11from
bodyhedia44:MDEV-37842-fix-implicit-gtid-warning

Conversation

@bodyhedia44
Copy link

MDEV-37842 Skip implicit Using_Gtid warning when value is unchanged

Description

When a replica already has Using_Gtid=No and a CHANGE MASTER TO is 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 explicit master_use_gtid, the code implicitly sets Using_Gtid to No and emits a warning. The condition only checks whether master_use_gtid=No was explicitly given — it does not check whether Using_Gtid is already No. This causes the "from No to No" warning.

Fix

Added a check that the current Using_Gtid value differs from USE_GTID_NO before 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:

-- Set Using_Gtid to No
CHANGE MASTER TO MASTER_USE_GTID=NO;

-- Before fix: produces "changing from 'No' to 'No'" warning
-- After fix: no warning
CHANGE MASTER TO relay_log_pos=0;
SHOW WARNINGS;

Expected (after fix): Empty result — no warning.

Verify the warning still fires when the value actually changes:

-- Set Using_Gtid to Slave_Pos
CHANGE MASTER TO MASTER_USE_GTID=Slave_Pos;

-- Should produce a warning: changing from 'Slave_Pos' to 'No'
CHANGE MASTER TO relay_log_pos=0;
SHOW WARNINGS;

Expected: Note 4190: CHANGE MASTER TO is implicitly changing the value of 'Using_Gtid' from 'Slave_Pos' to 'No'

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant