DOCS-6581 Document the replica gate on automatic binlog purge - #1031
Open
mariadb-stefan-hinz wants to merge 1 commit into
Open
mariadb-stefan-hinz wants to merge 1 commit into
mariadb-stefan-hinz wants to merge 1 commit into
Conversation
Reported by Shawn Green in #docs-talk. Two fixes, plus two drive-bys
found while verifying them.
slave_connections_needed_for_purge gates every automatic purge the
binlog maintenance page describes, and was mentioned nowhere on it: a
primary with no connected replica never purges automatically, so its
disk can fill even when expiry is set correctly. Added a warning with
the default (1, and 0 on Galera nodes), the error-log note each refusal
writes, and the escape hatch.
The :mm: emoji on PURGE BINARY LOGS was already "fixed" in GITBOOK-2395
by deleting the minutes, leaving the wrong format string
'YYYY-MM-DD hh:ss'. Restored it, code-spanned so the shortcode cannot
parse, and code-spanned the two remaining unfenced hh:mm:ss in the
datetime guide.
Also documented, since it decides whether the reader can purge by hand:
PURGE BINARY LOGS ignores the replica count from 11.4.3 (MDEV-34504) --
in 11.4.1 and 11.4.2 only the TO form did -- but a manual purge still
inherits a refused automatic purge's block, reported as "it is the
current active binlog" when it is not.
Drive-by fixes:
- The variable's documented range was a ulonglong max
(18446744073709551615); it is a uint, so 4294967295.
- Three missing spaces on the PURGE BINARY LOGS page, left by the
KB-to-GitBook migration ("name ordate", "synonyms.Deleted", "MASTER).To").
Verified against mariadb-server @ b2a8c2234db and executed on a live
12.3.3 server; codespell, lychee (401 links, 0 errors), doc-lint and
fragcheck all clean.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reported by Shawn Green in
#docs-talk, filed by Tauseef Khan as DOCS-6581. Both items in the ticket, plus two drive-by fixes the verification turned up.1. The binlog maintenance page never mentioned the gate
slave_connections_needed_for_purgegates every automatic purge Using and Maintaining the Binary Log describes —max_binlog_total_size,binlog_expire_logs_secondsandexpire_logs_daysalike — and appeared nowhere on it. The default is1, so a primary with no connected replica never purges automatically and its disk can fill up even when expiry is configured correctly.Added a warning that names the three mechanisms, the default (
1, and0on Galera cluster nodes), the error-log note each refusal writes, and the escape hatch.Executed rather than reasoned about, on the live 12.3.3 server with zero dump threads and 34 binlogs:
SET GLOBAL binlog_expire_logs_seconds=60; FLUSH BINARY LOGS;deleted nothing, and the error log got exactly the note the page now quotes.2. The
:mm:emoji — already "fixed" by deleting the minutesGITBOOK-2395 (
adc902e87, 2026-09-03) removed the Hungarian flag from the format string by removingmm, leaving`YYYY-MM-DD hh:ss`— no emoji, and no minutes either. Restored to`YYYY-MM-DD hh:mm:ss`, code-spanned so the shortcode cannot parse.The ticket asked for a grep for other unfenced occurrences: two, both in the datetime guide's format-specifier list (
%r,%T), now code-spanned. Every otherhh:mm:ssin the repo is already inside a fence or a code span.3. Manual purge vs. the gate — the ticket's version claim was wrong twice
The ticket said manual
PURGE BINARY LOGSwas blocked in 11.4.0–11.4.2. Both bounds are wrong and so is the scope:18dfcfdecf4(MDEV-31404), first released in 11.4.1 — there is no 11.4.0 behavior to describe.PURGE BINARY LOGS BEFOREobserved the limit;TOignored it from the start.dd997809679(MDEV-34504) first ships in 11.4.3, after whichcan_purge_log()passes0for an interactive purge.But it does not end there, and this is the part a reader hitting it needs: the short circuit at
sql/log.cc:6592sits before theinteractivecheck and caches the last failed purge, so a manual purge of a file whose automatic purge was just refused is refused too — reported asit is the current active binlogwhen it is not. Reproduced live (two refusals against…-bin.000001while…-bin.000035was active), and cleared by writing to the variable, after which the same statement purged. Documented as observed.Server-side finding, not fixed here: that wrong reason string looks like an MDEV worth filing.
Drive-by fixes
slave_connections_needed_for_purge's documented range carried a ulonglong max (18446744073709551615). It is aSys_var_uintwithVALID_RANGE(0, UINT_MAX), and the live server reports4294967295.Verification
Source:
mariadb-server @ b2a8c2234dbc276fe3947633c9ffea454badf48f(refmain). Oracle: live12.3.3-MariaDB-log. Eleven claims — 8 VERIFIED, 3 CORRECTED, 0 UNVERIFIED; the full fact-check report goes on the ticket at handoff.Local checks:
doc-lint.sh(4 files) clean,codespellclean,lychee401 links / 0 errors,fragcheck new origin/mainreports no new dead anchors.Not verified: the passing side of the gate (enough replicas connected → purge proceeds) is source-read only, since there is no replica here.