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

PURGE BINARY LOGS not working anymore

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 11.4.1, 11.4.2
    • 11.4.3
    • Replication
    • None

    Description

      We upgraded all our MariaDB/Galera clusters last week from 10.11.7 to 11.4.2.

      Since then we noticed that the binary logs aren't automaticly purged anymore on many nodes. (Yes, new binlogs are created)

      Also on manually calling 'PURGE BINARY LOGS', we don't get any error, but it does nothing.

      We don't see any issues on standalone MariaDB nodes, so it might be Galera related.

      It looks like the purging does work on Galera member nodes where an async replica is connected.

      Relevant settings;

      expire_logs_days = 1
      log_bin
      log_slave_updates
      

      Attachments

        Issue Links

          Activity

            For now I am going with both.

            Great!

            a.bieleman André Bieleman added a comment - For now I am going with both. Great!
            seppo Seppo Jaakola added a comment -

            it is ok to have different default option values for cluster operation, as cluster and stand-alone server are quite different use cases, after all. 'wsrep_on' variable could be used to identify cluster use case

            seppo Seppo Jaakola added a comment - it is ok to have different default option values for cluster operation, as cluster and stand-alone server are quite different use cases, after all. 'wsrep_on' variable could be used to identify cluster use case

            Pushed a fix to bb-11.4-monty for final review and testing.
            Here is the user visible changes from the commit comment:

            MDEV-34504 PURGE BINARY LOGS not working anymore

            PURGE BINARY LOGS did not always purge binary logs. This commit fixes
            some of the issues and adds notifications if a binary log cannot be
            purged.

            User visible changes:

            • 'PURGE BINARY LOG TO log_name' and 'PURGE BINARY LOGS BEFORE date'
              worked differently. 'TO' ignored 'slave_connections_needed_for_purge'
              while 'BEFORE' did not. Now both versions ignores the
              'slave_connections_needed_for_purge variable'.
            • 'PURGE BINARY LOG..' commands now returns 'note' if a binary log cannot
              be deleted like
              Note 1375 Binary log 'master-bin.000004' is not purged because it is
              the current active binlog
            • Automatic binary log purges, based on date or size, will write a
              note to the error log if a binary log matching the size or date
              cannot yet be deleted.
            • If 'slave_connections_needed_for_purge' is set from a config or
              command line, it is set to 0 if Galera is enabled and 1 otherwise
              (old default). This ensures that automatic binary log purge works
              with Galera as before the addition of
              'slave_connections_needed_for_purge'.
              If the variable is changed to 0, a warning will be printed to the error
              log.
            monty Michael Widenius added a comment - Pushed a fix to bb-11.4-monty for final review and testing. Here is the user visible changes from the commit comment: MDEV-34504 PURGE BINARY LOGS not working anymore PURGE BINARY LOGS did not always purge binary logs. This commit fixes some of the issues and adds notifications if a binary log cannot be purged. User visible changes: 'PURGE BINARY LOG TO log_name' and 'PURGE BINARY LOGS BEFORE date' worked differently. 'TO' ignored 'slave_connections_needed_for_purge' while 'BEFORE' did not. Now both versions ignores the 'slave_connections_needed_for_purge variable'. 'PURGE BINARY LOG..' commands now returns 'note' if a binary log cannot be deleted like Note 1375 Binary log 'master-bin.000004' is not purged because it is the current active binlog Automatic binary log purges, based on date or size, will write a note to the error log if a binary log matching the size or date cannot yet be deleted. If 'slave_connections_needed_for_purge' is set from a config or command line, it is set to 0 if Galera is enabled and 1 otherwise (old default). This ensures that automatic binary log purge works with Galera as before the addition of 'slave_connections_needed_for_purge'. If the variable is changed to 0, a warning will be printed to the error log.

            Reviews done, 'final version sent to buildbot for testing'

            monty Michael Widenius added a comment - Reviews done, 'final version sent to buildbot for testing'

            Pushed to 11.4

            monty Michael Widenius added a comment - Pushed to 11.4

            People

              monty Michael Widenius
              a.bieleman André Bieleman
              Votes:
              0 Vote for this issue
              Watchers:
              8 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.