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

relay_log_pos is not validated on use

    XMLWordPrintable

Details

    Description

      relay_log_pos has its validity checked at CHANGE MASTER time rather than when opening the relay log.
      This means, although CHANGE MASTER cannot set relay_log_pos to a nonëxistent (past-EOF) file position, it can still become nonëxistent outside of CHANGE MASTER if:

      • The relay log is manually truncated (that is, without using a Server feature like RESET SLAVE), or
      • The slave is restarted to load a manually-edited relay-log.info (relay_log_pos is the 3rd line).

      The SQL Thread will silently (attempt to) seek to the past-EOF location of the file.
      On my Ubuntu 25.10 (so probably all Linux), the seek is clamped to EOF, and the SQL thread continues with no further issues.
      But on a Windows debug CI, it failed the assertion my_b_tell(cur_log) == event_relay_log_pos.

      By editing the relay-log.info, relay_log_pos can also be set to a number < 4.
      This will fail the assertion event_relay_log_pos >= 4 on a debug build.

      Note that reloading of CHANGE MASTER options from master/relay_log.info without constraint verification is usually fine, as other invalid options naturally become runtime errors; e.g. for master_log_pos:

      Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the first event 'master-bin.000001' at 1048576, the last event read from 'master-bin.000001' at 4, the last byte read from 'master-bin.000001' at 4.'

      Attachments

        Issue Links

          Activity

            People

              ParadoxV5 Jimmy Hú
              ParadoxV5 Jimmy Hú
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m

                  Git Integration

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