Repository navigation
feat(admin): monitor replication - #625
Merged
Merged
Conversation
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]>
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.
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
SHOW BINARY LOG STATUSSHOW MASTER STATUSEach 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-8to it, and read whatSHOW REPLICA STATUSandSHOW REPLICASactually return. That's whereReplica_SQL_Running_Statecame from — and the emptyHostinSHOW REPLICAS, which is why the table says "not reported" rather than showing a blank: a replica reports its host only if started withreport_host, and most aren't.Two readings that matter
0would 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.