Skip to content

feat(admin): monitor replication - #625

Merged
EVWorth merged 1 commit into
mainfrom
feat/admin-replication
Sep 10, 2026
Merged

EVWorth merged 1 commit into
mainfrom
feat/admin-replication

Conversation

@EVWorth

@EVWorth EVWorth commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Closes #434. Last of the admin audit.

A Replication tab shows whichever side the server is on: replica status with thread state, lag and last errors; the binary log position; and connected replicas. A server that is neither says so — that's the normal state for a standalone server, not an error.

Two vocabularies, not one

MySQL renamed every status column in 8.0.22 (Slave→Replica, Master→Source); MariaDB kept the old ones. A reader that knows one vocabulary reports nothing on the other server — and does it silently, because the column is absent rather than wrong. Both are read.

Neither statement spelling works everywhere

MySQL 8.0.46 MariaDB 11 MySQL 8.4
SHOW BINARY LOG STATUS ERROR 1064 ok ok
SHOW MASTER STATUS ok ok removed

Each read tries the modern name and falls back.

The column names aren't from a manual

I brought up a second MySQL 8.0.46 container, replicated mas-mysql-8 to it, and read what SHOW REPLICA STATUS and SHOW REPLICAS actually return. That's where Replica_SQL_Running_State came from — and the empty Host in SHOW REPLICAS, which is why the table says "not reported" rather than showing a blank: a replica reports its host only if started with report_host, and most aren't.

Two readings that matter

  • "Connecting" is neither Yes nor No. Treating it as running would show a healthy replica that's failing to attach.
  • NULL lag is "cannot tell", usually because the IO thread is down. Rendering it as 0 would read as perfectly in sync — the two states an operator most needs to tell apart.

Verification

16 parser tests, 7 tab tests. Unit 2245, browser 297, 0 lint errors.

FR-7.2.4 asked for replication monitoring and there was none — no commands,
no parsing, no UI (#434). A Replication tab now shows whichever side the
server is on: replica status with thread state, lag and last errors; the
binary log position; and the replicas connected to it. A server that is
neither says so, because that is the normal state for a standalone server
rather than an error.

Two vocabularies have to be read, not one. MySQL renamed every status column
in 8.0.22 — Slave to Replica, Master to Source — and MariaDB kept the old
ones. A reader that knows a single vocabulary reports nothing on the other
server, and does it silently, because the column is absent rather than
wrong.

Both statement spellings have to be tried, too, and neither works everywhere:

  SHOW BINARY LOG STATUS   MySQL 8.0.46 ERROR 1064, MariaDB ok, MySQL 8.4 ok
  SHOW MASTER STATUS       MySQL 8.0.46 ok, MariaDB ok, removed in MySQL 8.4

So each read tries the modern name and falls back to the older one.

The column names are not from a manual. I brought up a second MySQL 8.0.46
container, replicated mas-mysql-8 to it, and read what SHOW REPLICA STATUS
and SHOW REPLICAS actually return — which is where Replica_SQL_Running_State
and the empty Host in SHOW REPLICAS came from. The latter is why the table
says "not reported" rather than showing a blank: a replica reports its host
only if started with report_host, and most are not.

Two readings are deliberate rather than incidental. "Connecting" is neither
Yes nor No, and treating it as running would show a healthy replica that is
failing to attach. A NULL lag is the server saying it cannot tell, usually
because the IO thread is down, and rendering it as 0 would read as perfectly
in sync — the two states an operator most needs to tell apart.

Closes #434

Co-Authored-By: Claude Opus 5 <[email protected]>
@EVWorth
EVWorth merged commit 1cf6b31 into main Sep 10, 2026
12 checks passed
@EVWorth
EVWorth deleted the feat/admin-replication branch September 10, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P1] [bug] FR-7.2.4 Replication monitoring — no implementation, no commands, no UI

1 participant