Cases2 cases
1 to 2 of 2
- Symptoms
On 18 September 2024, while a cookbook was reconfiguring Wikimedia's core MariaDB databases from one-way eqiad -> codfw replication to circular replication ahead of a datacenter switchover, replication in the codfw -> eqiad direction broke on the x1 and es6 sections. Engineers watching the run noticed at 21:28 UTC that the x1 primary was not replicating.
- Trigger
Running the cookbook sre.switchdc.databases.prepare, which set up codfw -> eqiad replication and started pt-heartbeat, on the row-based x1 and es sections.
- Root cause
- Component
- Contributing factor
- Detection
Engineers watching the first run of the automation saw on orchestrator that the x1 primary was not replicating, because monitoring of circular replication was not yet enabled. The break in the eqiad -> codfw direction was reported by Icinga.
- Remediation
- Skipped replication of the heartbeat tables with Replication_wild_ignore_table='heartbeat.%'
- Inserted the missing heartbeat row with binary logging off on the es hosts
- Inserted the missing heartbeat row with binary logging off on the x1 codfw hosts and removed the ignore rule
- Action items
- Avoid the same issue again, probably by inserting the missing row when it is detected
- Add a post-maintenance health check that replication works in both directions
- Add options to run the maintenance in another order or on each section individually
- Update the Phabricator task for each section rather than only at the end
- Fix the monitoring gaps for circular replication
- Made pt-heartbeat-wikimedia use STATEMENT format for its session on the x1 and row-based read-write es hosts, fixed in a later deploy
- Lessons
Circular replication is not a normal working mode, so the first fix only moved the break to the other side; TRUNCATE would have worked better than DELETE because it always replicates as a statement, but it was not considered because it is more dangerous. Running sql_skip_slave_counter was avoided, since it could have made things worse or lost data. The check of the replication channel should also run once all tasks are complete, not only right after setup. The combination of row-based replication, pt-heartbeat and differing heartbeat rows was not described in earlier maintenance or documentation.
IL-0215Twilio's billing Redis master lost all balances and went read-only, and auto-recharge charged customer cards repeatedlyTwilio2013- Symptoms
At 2:39 AM PDT (9:39 UTC) on 18 July 2013, services that relied on the redis-master of Twilio's billing system began to fail because the load on its host had become extreme. At 2:42 AM PDT monitoring alerted the on-call engineers to a failure in the Redis cluster.
- Trigger
At 1:35 AM PDT on 18 July a loss of network connectivity disconnected all billing redis-slaves from the redis-master at once, and all of them requested a full synchronization at the same time. On-call engineers then restarted the overloaded redis-master.
- Root cause
- Component
- Contributing factor
- Detection
At 2:42 AM PDT monitoring alerted the on-call engineers to a failure in the Redis cluster. At 3:28 AM PDT the billing system monitoring reported the anomalous charges, and at 12:36 PM PDT monitoring detected the recurrence.
- Remediation
- Restarted the redis-master to relieve the high load, which loaded a wrong configuration
- Took the billing system offline to stop further credit card charges
- Restored service to all suspended accounts
- Restored the lost account balances from the independent double-bookkeeping record in the relational datastore
- Took billing offline again after the recurrence and reactivated the newly suspended accounts
- Refunded all erroneous credit card charges
- Gave all affected accounts a credit of 10% of their last 30 days of spend
- Replaced the original Redis cluster and corrected the redis-master configuration
- Activated the billing system progressively for groups of customer accounts
- Action items
- Disable Redis restarts on the redis-master and recover the master by pivoting a slave instead
- Add fail-safes so the billing system neither suspends accounts nor charges cards when balances are missing or cannot be written
- Validate the billing system against the double-bookkeeping databases in real time
- Lessons
Losing the in-flight balances and the ability to write balances at the same time exposed a flaw in the auto-recharge system: it failed in a dangerous way, charging cards and suspending accounts instead of stopping.
These 2 cases involve Database replication and In-memory cache. kubegap audits a Kubernetes cluster for gaps like these, read-only, from Claude Code or Codex; its checks cite public reports like the ones in this library.
By root cause1
Configuration change2 cases
- Contributing factor
- Organisation