Skip to content
/ server Public

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'

@ParadoxV5 ParadoxV5 requested a review from gkodinov February 22, 2026 20:23
@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Feb 23, 2026
Copy link
Member

@gkodinov gkodinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. This is a preliminary review. Please add tests to cover the change. You seem to have a pretty clear path to reproduce. Just add that into a .test file.

@bodyhedia44
Copy link
Author

Done, I added the tests

@bodyhedia44 bodyhedia44 requested a review from gkodinov February 23, 2026 16:48
Copy link
Member

@gkodinov gkodinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect. Ticking my box. Stand by for the final review.

Please don't have multiple commits. Always squash your commits to a single one and update the commit message in the process.

Copy link
Member

@gkodinov gkodinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please re-record rpl.rpl_from_mysql80: it's failing because of your changes.

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.

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 but does not check whether
Using_Gtid is already No.

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.

Re-recorded rpl.rpl_from_mysql80 which previously expected the
spurious No-to-No warning.
@bodyhedia44 bodyhedia44 force-pushed the MDEV-37842-fix-implicit-gtid-warning branch from 8fa5b20 to f1cb337 Compare February 24, 2026 20:03
@bodyhedia44 bodyhedia44 requested a review from gkodinov February 24, 2026 20:23
@bodyhedia44
Copy link
Author

Done

Copy link
Member

@gkodinov gkodinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for working on this!

Stand by for the final review please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.

Development

Successfully merging this pull request may close these issues.

3 participants