Skip to content
/ server Public

Conversation

@ParadoxV5
Copy link
Contributor

@ParadoxV5 ParadoxV5 commented Jan 27, 2026

MDEV-5804 implemented @@gtid_ignore_duplicates on serial replication by overwriting @@sql_slave_skip_counter to 1, which MDEV-4937 reënabled in GTID replication.

To avoid conflicts at their root, this commit reïmplements @@gtid_ignore_duplicates so it no longer depends on @@sql_slave_skip_counter. The new implementation is located next to @@slave_skip_counter and utilizes the existing rpl_group_info::gtid_ignore_duplicate_state infrastructure, which was only used to update states, not by @@gtid_ignore_duplicates itself.

@ParadoxV5 ParadoxV5 requested a review from knielsen January 27, 2026 01:11
@ParadoxV5 ParadoxV5 added MariaDB Corporation Replication Patches involved in replication labels Jan 27, 2026
Copy link
Contributor Author

@ParadoxV5 ParadoxV5 Jan 27, 2026

Choose a reason for hiding this comment

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

This section is after the block where this driver SQL thread dismisses queues events to its workers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We might be able to remove the @@gtid_ignore_duplicates code on the Parallel side as well now, but I don’t dare, and so leave it to MDEV-30458 Consolidate Serial Replica to Parallel Replica with 1 Worker Thread.

rli->slave_skip_counter));
if ((server_id == global_system_variables.server_id &&
!(rli->replicate_same_server_id || (flags & LOG_EVENT_ACCEPT_OWN_F))) ||
rli->gtid_skip_flag ||
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Parallel mode should (at least I expect) handle Relay_log_info::gtid_skip_flag separately, so gtid_skip_flag-skipped events should never reach the amended code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I replaced Relay_log_info::gtid_skip_flag with rpl_group_info::gtid_ignore_duplicate_state; my expectation still applies.

@ParadoxV5 ParadoxV5 marked this pull request as draft January 27, 2026 03:22
…s by `@@gtid_ignore_duplicates`

MDEV-5804 implemented `@@gtid_ignore_duplicates`
on serial replication by overwriting `@@sql_slave_skip_counter` to 1,
which MDEV-4937 reënabled in GTID replication.

To avoid conflicts at their root, this commit reïmplements
`@@gtid_ignore_duplicates` so it no longer depends on
`@@sql_slave_skip_counter`. The new implementation is located next to
`@@replicate_events_marked_for_skip` and makes use of the existing
`rpl_group_info::gtid_ignore_duplicate_state` infrastructure, which was
only used for updating states, not by `@@gtid_ignore_duplicates` itself.

Reviewed-by: Kristian Nielsen <knielsen@knielsen-hq.org>
@ParadoxV5 ParadoxV5 marked this pull request as ready for review January 28, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MariaDB Corporation Replication Patches involved in replication

Development

Successfully merging this pull request may close these issues.

2 participants