IL-0303 GitHub · 2012-09-10database
GitHub's MySQL master failed over to a node with a cold buffer pool during a schema migration and GitHub.com went down
In mid-August 2012 GitHub replaced its pair of DRBD-backed MySQL servers with a three-node cluster. Pacemaker and Heartbeat manage two virtual IPs, one read/write and one read-only, and Percona Replication Manager, a resource agent for Pacemaker, moves the 'active' role (the master that takes reads and writes) and the 'standby' role (a read-only slave) between the nodes. MySQL runs on every node, so a failover only moves a virtual IP after flushing transactions and changing the read_only variable.
On September 10th a schema migration loaded the master so much that the replication manager's health checks failed; it moved the active role to another node and stopped MySQL on the original one. The new master had a cold InnoDB buffer pool, failed its health checks under the site's load, and the role moved back. The team enabled Pacemaker's maintenance-mode to stop all health checks and automatic failover, and performance recovered as the buffer pool warmed. Maintenance-mode also kept the standby from switching to its new master and replicating, so it returned incorrect results. On September 11th, an attempt to disable maintenance-mode caused a Pacemaker segfault and a partition of the cluster state; two master elections ran without coordination, and the out-of-date node 'c' became master by itself at 8:19 AM. The team powered it off at 8:26 AM, which took github.com down, could not change the cluster state afterwards, and so stopped Pacemaker and Heartbeat on nodes 'a' and 'b', started them on 'a', and started MySQL there in the active role. The site recovered as the buffer pool warmed.
GitHub uses Redis to look up dashboard event stream entries and repository routes by ids that MySQL generates. For records created while node 'c' was master, those ids no longer matched, so some events appeared on the wrong users' dashboards and some new repositories were routed wrongly. 16 of those repositories were private and could be reached by people outside their collaborators and teams for seven minutes, from 8:19 AM to 8:26 AM PDT on September 11th. GitHub named the automated failover of its main production database as the root cause of both outages, which together caused one hour and 46 minutes of downtime and another hour of significantly degraded performance.
- Severity
- –
- Scope
- GitHub.com had one hour and 46 minutes of downtime and another hour of significantly degraded performance over two outages; some events appeared on wrong dashboards and 16 private repositories were reachable by outsiders for seven minutes
- Users affected
- –
- Region
- –
- Time to detect
- –
- Time to resolve
- –
Symptoms
On Monday, September 10th, 2012, during a schema migration, the health checks on GitHub's MySQL master failed and Percona Replication Manager moved the 'active' role to another node of the new three-node cluster. That node's InnoDB buffer pool was cold and it performed poorly, its health checks failed in turn, and the role failed back to the original server. GitHub.com went down.
The migration, run with GitHub's two-pass system for zero-downtime MySQL schema changes, put more load on the database than the operations team had seen in earlier migrations of this kind. When the health checks failed, the replication manager also stopped MySQL on the node it judged failed. On the new master, the site's query load against a cold cache made the health checks fail again.
To stop the failovers the team put Pacemaker into maintenance-mode, in which no health checks or automatic failovers run, and the site recovered slowly as the buffer pool warmed. The next morning a developer reported incorrect query results from the 'standby' node: maintenance-mode had also blocked the steps that should have pointed the standby at its new master and started replication.
When the team tried to disable maintenance-mode on Tuesday, September 11th, Pacemaker segfaulted and the cluster state split, with nodes 'a' and 'b' rejecting most messages from node 'c' and the other way round, although the cluster was configured to need a majority before acting. Node 'c', the out-of-date one, was elected master on its own at 8:19 AM. The team powered it off at 8:26 AM to stop further data drift, which cut all production database access and took down all of github.com.
Symptom Failover failureDatabase overloadHigh latencyReplication lagSplit brainService outage
Root cause
Root cause Software defect
- Trigger
- A schema migration on Monday, September 10th put more load on the master database than earlier migrations had, and Percona Replication Manager's health checks on the master failed.
Detection
On the morning of September 11th, a developer told the operations team that the 'standby' node was returning incorrect query results.
Remediation
- Enabled Pacemaker's maintenance-mode so no health checks or automatic failovers ran, and let the buffer pool warm
- Powered off the out-of-date node 'c' to end the partition
- Stopped Pacemaker and Heartbeat on nodes 'a' and 'b' and started them on node 'a' only
- Started MySQL on node 'a' in the active role
- Removed the events leaked to wrong dashboards and audited the wrongly routed repositories
- Contacted the owners of the exposed private repositories
Action items
- Change the Pacemaker configuration so the active database role fails over only when an operations engineer starts it
- Find a way to warm the InnoDB buffer pool of slave databases so failovers do not hurt performance
- Audit the Pacemaker and Heartbeat stack, focusing on the code path behind the segfault
- Run hardware tests on the server where the segfault happened
Lessons
GitHub concluded that automated failover is not the right strategy for its primary production database: for every failover in this incident, any member of the operations team would have said it should not happen. Failovers that must happen, in an emergency or during maintenance, should not hurt performance.
Sources
Related cases
IL-0281PostHog's Logs ClickHouse cluster silently deleted almost all its S3 data, losing US logs older than 3 daysPostHog · 2026same root cause · shared Database replication, Database
IL-0310An Aurora PostgreSQL failover to an upsized reader reversed twice and backend writes failed in read-only transactionsHightouch · 2025same root cause · shared Database failover manager, Database
IL-0527OpenStreetMap.org made no replication diffs for 16 hours as PostgreSQL logical decoding failed on a memory alloc errorOpenStreetMap Foundation · 2025same root cause · shared Database replication, Database
IL-0241A database shard could not elect a new primary, and the Stripe API failed most requests in two periods on one dayStripe · 2019same root cause · shared Database failover manager, Database
IL-0589Every Kickstarter MySQL replica on Amazon RDS stopped replicating on a duplicate-key error in the backings tableKickstarter · 2013same root cause · shared Database replication, Database
IL-0451Setting indexes INVISIBLE on Aurora MySQL 3.10 spiked CPU and ReadIOPS on all three readers but not on the writerDaangn · 2026same root cause · shared Database
IL-0313Decagon voice requests stalled for exactly 300 seconds behind self-managed PgBouncer and exhausted the SQLAlchemy poolDecagon · 2026same root cause · shared Database
IL-0150A latent race condition in DynamoDB's DNS automation left an empty DNS record for dynamodb.us-east-1.amazonaws.com, and the DynamoDB and EC2 launch failures that followed caused EKS, ECS and Fargate container launch failures and cluster scaling delays in us-east-1Amazon Web Services · 2025same root cause · shared Database
IL-0436A supremum lock left by ROLLBACK TO SAVEPOINT in a long transaction blocked inserts and filled Aurora MySQL connectionsfreee · 2025same root cause · shared Database
IL-0329A routine migration left PGAudit stuck holding Postgres locks, causing intermittent timeouts and a 2-minute outageincident.io · 2025same root cause · shared Database
IL-0376A maintenance update set off needless full syncs between Upstash Redis replicas in eu-west-1, slowing the databasesUpstash · 2025same root cause · shared Database replication
IL-0347About 25% of Scaleway FR-PAR-1 hypervisors lost VPC connectivity when both VPC BGP route reflectors got stuckScaleway · 2024same root cause · shared Database
IL-0373Heroku Postgres Essential-tier databases in the EU region ran out of memory and refused connections, twice in four daysHeroku · 2024same root cause · shared Database
IL-0024Expensive cache-backed API calls and uncancelled database requests overloaded MongoDB and took the Hugging Face Hub down three timesHugging Face · 2024same root cause · shared Database
IL-0217Honeycomb's main MySQL database locked up under cache-miss reads and ran out of connections, a 68-minute total outageHoneycomb · 2023same root cause · shared Database
IL-0330Requests timed out for two weeks waiting on Go's database/sql connection pool, one for almost 20 secondsincident.io · 2023same root cause · shared Database
IL-0295Pusher's Channels publish API on the mt1 cluster was largely unavailable for 11 minutes while a Redis master failed overPusher · 2022same root cause · shared Database failover manager
IL-0385GitHub MySQL read replicas hit a semaphore deadlock during a schema migration's table rename and kept crash-recoveringGitHub · 2021same root cause · shared Database
IL-0462Some MySQL pods on Shopify's GKE clusters took up to 30 minutes to start, slowing instance replacementShopify · 2021same root cause · shared Database
IL-0196Adding a second Redis replica and lowering memory limits in one RedisFailover change restarted the only Redis pod that held data, and Sentinel promoted the empty new replica, erasing the dataPalark · 2020same root cause · shared Database
IL-0486Figma's PostgreSQL 9 database on RDS slowed under high write IOPS and lock contention until the site was unavailableFigma · 2020same root cause · shared Database
IL-0439Database access slowed after each block device and filesystem expansion because the Linux kernel dropped the page cacheCybozu · 2018same root cause · shared Database
IL-0388A Google Cloud live migration took a Discord Redis primary offline, and the failover broke API instances and then guildsDiscord · 2017same root cause · shared Database
IL-0454Baemin billing servers could not open new MariaDB connections at the start of a card-discount eventWoowa Brothers · 2016same root cause · shared Database
IL-0536Amazon SimpleDB in US East returned HTTP 500 to nearly all API calls for two hours after its nodes left the clusterAmazon Web Services · 2014same root cause · shared Database
IL-0485Dropbox went down when an OS upgrade script reinstalled active MySQL master-replica pairs and backup restores ran slowDropbox · 2014same 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-0303
- The cases most like it: https://incidentlib-api.benchlet.com/cases/IL-0303/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.