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

Binlog expiry broken when slave_connections_needed_for_purge > 0

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 11.4.5
    • N/A
    • Replication
    • None

    Description

      If there are binary logs to be purged at primary server start up within the value of expire_logs_days and slave_connections_needed_for_purge > 0 then the server appears to not purge logs regardless of whether a connecting replica node has processed the event or not. Binlog expiry never occurs after the note is shown.

      Steps to replicate:

      • Set up replication between two servers
      • Create some events on the primary and flush logs

        CREATE DATABASE testing;
        CREATE TABLE testing.t1 (id int);
        INSERT INTO TABLE testing.t1 VALUES(1);
        FLUSH BINARY LOGS;
        

      • Ensure the replica has processed all events on the primary. The binary log file should match the output from show master status on the primary:

        mariadb -e "show all slaves status\G"|grep \ Master_Log_File
        

      • Set binlog_expire_logs_seconds=10 on the primary and restart

      At this point the primary should show a similar note in the error log:

      2025-02-17 11:23:34 0 [Note] Binary log 'rocky9-MariaDB1-bin.000001' is not purged because less than 'slave_connections_needed_for_purge' slaves have processed it
      

      Binary logs will not ever be expired after this note is shown, though a manual PURGE BINARY LOGS will work.

      Attachments

        Activity

          Ali.maria Alasdair Haswell created issue -
          serg Sergei Golubchik made changes -
          Field Original Value New Value
          Fix Version/s 11.4 [ 29301 ]
          Fix Version/s 11.4.6 [ 29999 ]
          elenst Elena Stepanova made changes -
          Component/s Replication [ 10100 ]
          Assignee Brandon Nesterenko [ JIRAUSER48702 ]
          elenst Elena Stepanova made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]
          Elkin Andrei Elkin made changes -
          Assignee Brandon Nesterenko [ JIRAUSER48702 ] Andrei Elkin [ elkin ]
          Elkin Andrei Elkin made changes -
          Fix Version/s N/A [ 14700 ]
          Fix Version/s 11.4 [ 29301 ]
          Resolution Not a Bug [ 6 ]
          Status Confirmed [ 10101 ] Closed [ 6 ]

          People

            Elkin Andrei Elkin
            Ali.maria Alasdair Haswell
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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