Skip to content

Conversation

ParadoxV5
Copy link
Contributor

  • The Jira issue number for this PR is: MDEV-37146

Description

SELECT … FROM information_schema.SLAVE_STATUS is an alternative to SHOW SLAVE STATUS that supports WHERE and column selection.
Utilizing this server-side feature allows mariadb-dump --dump-slave to iterate only the required data on the client side.

Release Notes

Optimized mariadb-dump --dump-slave for MariaDB 10.0 and above.

How can this PR be tested?

Test mariadb-dump --dump-slave as usual, e.g., through MTR tests main.rpl_mysqldump_slave & multi_source.mariadb-dump_slave.

Basing the PR against the correct MariaDB version

  • This is a new feature or a refactoring, and the PR is based against the main branch.
  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

…tion_schema.SLAVE_STATUS

`SELECT … FROM information_schema.SLAVE_STATUS` is an alternative
to `SHOW SLAVE STATUS` that supports `WHERE` and column selection.
Utilizing this server-side feature allows `mariadb-dump --dump-slave`
to iterate only the required data on the client side.
@ParadoxV5 ParadoxV5 requested a review from bnestere September 5, 2025 18:38
@ParadoxV5 ParadoxV5 added MariaDB Corporation Replication Patches involved in replication labels Sep 5, 2025
Comment on lines 7510 to -7583
/* Check if the server support multi source */
if (mysql_get_server_version(mysql) >= 100000)
{
multi_source= 2;
have_mariadb_gtid= 1;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Re: #3780 (comment)

This patch currently drops support for versions that didn’t have multi-source, which are before 10.0.
Is this acceptable because they have long been EOL?

Additionally, to what extent should this program continue to support dumping MySQL?

Comment on lines +6490 to +6491
"SELECT Connection_name, Master_Host, Master_Port,"
"Master_Log_File, Exec_Master_Log_Pos FROM information_schema.SLAVE_STATUS")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧐 the index-9 column… This should be

Suggested change
"SELECT Connection_name, Master_Host, Master_Port,"
"Master_Log_File, Exec_Master_Log_Pos FROM information_schema.SLAVE_STATUS")
"SELECT Connection_name, Master_Host, Master_Port, Relay_Master_Log_File,"
"Exec_Master_Log_Pos FROM information_schema.SLAVE_STATUS")

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.

1 participant