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

rpl.purge_binlog fails: PURGE BINARY LOGS purges master-bin.000001 instead of refusing it as in use by a slave thread

    XMLWordPrintable

Details

    Description

      rpl.purge_binlog fails on 11.4, 11.8, 13.1 and main with a result mismatch: PURGE BINARY LOGS TO 'master-bin.000002' returns no Note 1375 (ER_BINLOG_PURGE_PROHIBITED, "is in use by a slave thread") and master-bin.000001 is purged.

      Build Run Info

      Branch Builder name Date Commit Variant
      11.4 x86-debian-12-fulltest-debug 2026-10-14T18:31:17Z d0164223c5a7c9e6ec81c371ef42839616b8045b row
      11.8 x86-debian-12-fulltest-debug 2026-10-13T13:33:58Z db94f391be4e986be358be1e8e60c94758cc78ba row
      13.1 x86-debian-12-fulltest-debug 2026-10-13T14:45:37Z 5ab51d6248bb6dc2c5a8c3d3cd7a8d2d721224d8 row
      main x86-debian-12-fulltest-debug 2026-10-13T19:59:28Z 82964737c007bafad28cd45829874eb98593127a row

      Failure text

      rpl.purge_binlog 'row'                   w1 [ fail ]
              Test ended at 2026-10-14 16:35:04
       
      CURRENT_TEST: rpl.purge_binlog
      --- /home/buildbot/x86-debian-12-fulltest-debug/build/mysql-test/suite/rpl/r/purge_binlog.result	2026-10-14 15:34:20.000000000 +0000
      +++ /home/buildbot/x86-debian-12-fulltest-debug/build/mysql-test/suite/rpl/r/purge_binlog.reject	2026-10-14 16:35:03.994951159 +0000
      @@ -29,11 +29,8 @@
       master-bin.000001	#
       master-bin.000002	#
       PURGE BINARY LOGS TO 'master-bin.000002';
      -Warnings:
      -Note	1375	Binary log XXX is not purged because it is in use by a slave thread
       show binary logs;
       Log_name	File_size
      -master-bin.000001	#
       master-bin.000002	#
       connection slave;
       set @@global.debug_dbug= @old_dbug;
       
      Result length mismatch
       
       - saving '/home/buildbot/x86-debian-12-fulltest-debug/build/mysql-test/var/1/log/rpl.purge_binlog-row/' to '/home/buildbot/x86-debian-12-fulltest-debug/build/mysql-test/var/log/rpl.purge_binlog-row/'
       
      Retrying test rpl.purge_binlog, attempt(2/3)...

      The failure text is identical in the other 17 matching runs between 2026-10-09 and 2026-10-16, apart from worker id, timestamps and the var directory number: the other three release branches in the table, and 14 runs on feature and pull request branches (x86-debian-12-fulltest-debug, variant row): bb-11.4-spetrunia-cleanups, bb-12.3-bar-MDEV-41527, bb-cleanup-monty (2 runs), bb-query-cache, st-13.1-merge, and the pull request heads refs/pull/4817/head, refs/pull/5493/head, refs/pull/5617/head, refs/pull/5722/head, refs/pull/5783/head, refs/pull/5804/head, refs/pull/5825/head, refs/pull/5846/head.

      Analysis

      All 18 matching runs between 2026-10-09 and 2026-10-16 come from one builder, x86-debian-12-fulltest-debug, and no other builder reported this failure in that period, which points at the builder rather than at the code of a branch. In every run the first attempt fails (Retrying test rpl.purge_binlog, attempt(2/3)) and no run records a failed second attempt, so the failure appears to be intermittent. The test (MDEV-34504) holds the slave IO thread at pause_before_io_read_event, writes about 5 MB of row events into master-bin.000001, runs FLUSH BINARY LOGS and expects PURGE BINARY LOGS TO 'master-bin.000002' to be refused because log_in_use() finds a dump thread still positioned in master-bin.000001. In the failing runs log_in_use() finds none, so the dump thread has most likely already sent the whole file and moved on to master-bin.000002; how much data the paused connection can buffer depends on the host. The test and result files have not changed since 2026-01-01, and MDEV-41214 (11.4 commit d0164223c5a7) does not explain it: the 11.8, 13.1 and main builds above do not contain that fix.

      Created via the mtr-failure-create-bug skill.

      Attachments

        Issue Links

          Activity

            People

              Elkin Andrei Elkin
              susil.behera Susil Behera
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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