IL-0323 Wikimedia Foundation · 2019-09-22database
A RAID battery backup unit failure crashed db1075, the MariaDB primary of section s3, and every s3 wiki went read-only
db1075, the primary database of section s3 in eqiad, lost its RAID battery backup unit, and the failure crashed the whole host. With the primary unavailable, no writes could happen and every s3 wiki went read-only, while reads continued from the replicas. The host was power-cycled from the iDRAC, MySQL recovered InnoDB cleanly, and read_only was removed by hand. A race between pt-heartbeat, started by puppet, and MySQL not yet being fully up made the first manual puppet run fail unnoticed, so replication lag kept being reported and the outage lasted 8 minutes longer, until a second puppet run started pt-heartbeat at 19:16. Had the host not come back, the team would have had to fail over manually and promote a replica to primary.
HP hosts at Wikimedia had crashed on BBU failures before (T231638, T225391), and db1075 belongs to a batch of 6 servers, 3 of which had already had BBU problems (T233569). Replacing db1075 as primary with a host from outside that batch was the next step (T230783). The responders were 1 DBA, 2 SREs, 1 WMCS, 1 Dev and 1 Volunteer.
- Severity
- –
- Scope
- All s3 wikis were read-only for 36 minutes; reads were not affected
- Users affected
- –
- Region
- eqiad
- Time to detect
- 2m
- Time to resolve
- 36m
Symptoms
At 18:40 UTC db1075, the primary database of section s3, stopped answering, and all s3 wikis went read-only because no writes could reach it. Reads kept working from the replicas. At 18:42:45 Icinga reported "PROBLEM - Host db1075 is DOWN: PING CRITICAL - Packet loss = 100%".
The first error was logged by mysqld on db1115 at 18:40:38: "OpenTable: (2003) Can't connect to MySQL server on 'db1075.eqiad.wmnet' (110 "Connection timed out")". From 18:48 the s3 replicas db2105, dbstore1004 and db1095 alerted one after another with "PROBLEM - MariaDB Slave IO: s3 on db2105 is CRITICAL: CRITICAL slave_io_state Slave_IO_Running: No, Errno: 2003, Errmsg: error reconnecting to master [email protected]:3306", followed by more alerts. At 18:47 a user on #wikimedia-operations reported a warning on otrs-wiki about a high replag database lock, and that the wiki was slower than usual.
The HOST DOWN alert went only to IRC and did not page; the first SMS page went out at 18:56. A responder was connecting at 18:55:51; the team saw that the host was unresponsive with a BBU problem, and rebooted it from the iDRAC at 19:02. MySQL started InnoDB recovery at 19:03 and finished at 19:06, and read_only=ON was removed by hand at 19:07. Lag was still being reported at 19:08 although everything was up: a manual puppet run at 19:04 had failed without anyone noticing, so pt-heartbeat had not started. A second manual puppet run at 19:16 succeeded, pt-heartbeat started and the outage ended, about 8 minutes later than it could have.
Root cause
Root cause Hardware failure
- Trigger
- The RAID battery backup unit (BBU) of db1075, the s3 primary database host, failed and the whole host crashed.
Detection
Icinga reported db1075 HOST DOWN on IRC at 18:42:45, but that alert does not page; replica Slave IO alerts followed, users reported problems on #wikimedia-operations, and the first SMS page went out at 18:56. Volunteers and staff noticed the failure before the alerts did.
Remediation
- Power-cycled db1075 from the iDRAC after finding the BBU problem
- Let MySQL finish InnoDB recovery on db1075
- Removed read_only=ON from db1075 by hand
- Ran puppet by hand a second time so pt-heartbeat started
Action items
- Implement or refactor a script that moves replicas when the primary is unavailable
- Fix the MediaWiki heartbeat model so pt-heartbeat does not use a super-user, avoids a single point of failure and follows the real primary without depending on puppet
- Decide what to do with the batch of hosts that already had BBU issues
- Buy a new BBU for db1075
- Remove db1075 from the primary role
- Address MediaWiki spam while the database is read-only or the primary is unavailable
- Make primary database hosts page on HOST DOWN
- Track hardware errors better in Netbox
Lessons
A BBU failure should not crash a whole host, yet it had happened before on HP hosts. HOST DOWN on a primary database should page instead of only alerting on IRC. Starting pt-heartbeat through puppet races with MySQL startup, and the unnoticed failure kept lag reported and made the outage 8 minutes longer.
Sources
- https://wikitech.wikimedia.org/wiki/Incidents/2019-09-23_s3_primary_db_master_crash · runbook · archived copy
References
- https://raw.githubusercontent.com/wikimedia/operations-mediawiki-config/master/dblists/s3.dblist
- https://phabricator.wikimedia.org/T231638
- https://phabricator.wikimedia.org/T225391
- https://phabricator.wikimedia.org/T233569
- https://phabricator.wikimedia.org/T230783
- https://phabricator.wikimedia.org/T196366
- https://phabricator.wikimedia.org/T172497
- https://phabricator.wikimedia.org/T233567
- https://phabricator.wikimedia.org/T233623
- https://phabricator.wikimedia.org/T233684
- https://phabricator.wikimedia.org/T233774
Related cases
IL-0306A Neon pageserver's EC2 instance failed without warning and Postgres databases of 0.4% of us-east-1 projects stalledNeon · 2024same root cause · shared Database
IL-0508All SourceHut services went down when the main database server remilia.sr.ht failed in hardware and became unreachableSourceHut · 2023same root cause · shared Database
IL-0370Render Postgres databases in Frankfurt were down up to 65 minutes as their disks stayed attached to a failed nodeRender · 2022same root cause · shared Database
IL-0289A failing SSD made updown.io's primary MongoDB about 200 times slower, no failover happened and the site went downupdown.io · 2019same root cause · shared Database
IL-0219GoCardless's API and Dashboard failed every request for 1 hour 50 minutes when Pacemaker did not promote a replicaGoCardless · 2017same root cause · shared Database
Check your cluster for this
For AI tools and scripts
- This case as JSON: https://incidentlib-api.benchlet.com/cases/IL-0323
- The cases most like it: https://incidentlib-api.benchlet.com/cases/IL-0323/similar
- MCP server (Streamable HTTP, no key):
https://incidentlib-mcp.benchlet.com/mcp
The API needs no key. The MCP server offers search_incidents, get_incident, list_incidents, get_topic and vocab; both are explained on API and MCP.