Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-35635

START SLAVE UNTIL allows CHANGE MASTER TO options

    XMLWordPrintable

Details

    • Can result in unexpected behaviour
    • Command START SLAVE UNTIL would invalidly allow some CHANGE MASTER TO options (e.g. MASTER_USE_GTID, MASTER_DEMOTE_TO_SLAVE) despite not being valid for a START SLAVE command.
    • Q3/2025 Maintenance

    Description

      When using START SLAVE UNTIL, the UNTIL grammar rule uses master_file_def (through slave_until_opts), which is also used by CHANGE MASTER TO. This means that a START SLAVE UNTIL statement can use any option available to the master_file_def rule (e.g. master_use_gtid, master_demote_to_slave), despite not being valid for START SLAVE. For example:

      START SLAVE UNTIL relay_log_file='mariadb-bin.000002', relay_log_pos=50, master_demote_to_slave=1, master_use_gtid=no;
      

      The only constraint is that the master/relay log file/pos have to be set:

              | UNTIL_SYM slave_until_opts
                {
                  LEX *lex=Lex;
                  if (unlikely(((lex->mi.log_file_name || lex->mi.pos) &&
                               (lex->mi.relay_log_name || lex->mi.relay_log_pos)) ||
                               !((lex->mi.log_file_name && lex->mi.pos) ||
                                 (lex->mi.relay_log_name && lex->mi.relay_log_pos))))
                     my_yyabort_error((ER_BAD_SLAVE_UNTIL_COND, MYF(0)));
                }
      

      The valid options for START SLAVE UNTIL should be split from master_file_def to disallow this.

      Attachments

        Issue Links

          Activity

            People

              bnestere Brandon Nesterenko
              bnestere Brandon Nesterenko
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 3d
                  3d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 1.25d Time Not Required
                  1.25d

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.