IL-0281 PostHog · 2026-02-19databaseaws
PostHog's Logs ClickHouse cluster silently deleted almost all its S3 data, losing US logs older than 3 days
PostHog stores Logs data in a dedicated ClickHouse cluster, separate from the main ClickHouse cluster shared by most other PostHog products. The Logs cluster uses S3 disks: data parts are uploaded to S3 automatically after 24 hours, which lets it hold very large volumes (PostHog's own systems alone produce about 500MB/s of logs, or about 1PB/month uncompressed). The database has two replicas, but zero-copy replication, an experimental ClickHouse feature that ClickHouse does not recommend for production, had been turned on very early, when Logs was an internal-only tool, and the setting was not revisited when Logs was released to external users. With zero-copy replication the replicas share the same S3 objects, so there was no redundancy between the database logic and the storage, and S3 versioning was not enabled on the bucket.
At 11:02 UTC on 19 February the finished mutation triggered a zero-copy replication bug, and one replica wrongly concluded that none of the data parts in the database were referenced any more. Until 19:40 the replicas deleted the S3 data of the whole database; a fault that should have removed one replica's data removed it everywhere. At 19:40 a node crashed and could not start, and engineers found most S3-backed data missing. At 21:45 the data was judged most likely unrecoverable and disaster recovery began. At 22:15 the team decided to move to a new table and restore data from Kafka, which kept 3 days of retention, and by 23:00 the new table, without zero-copy replication, was in use and had caught up on recent messages. The backfill from Kafka history ran on 20 February from 10:05 to 12:21 UTC. Data older than the Kafka retention could not be restored.
- Severity
- –
- Scope
- Logs product: logs collected more than 3 days before the incident were lost; all other PostHog products and data were unaffected
- Users affected
- –
- Region
- US region
- Time to detect
- 8h 38m
- Time to resolve
- 25h 19m
Symptoms
On 19 February 2026, a node of the ClickHouse cluster behind PostHog's Logs product crashed, restarted and could not start again because it could not find a large amount of its data. Engineers then found that almost all of the Logs data stored on S3 was gone, so logs collected in the US region more than 3 days earlier were lost. Only the Logs product was affected.
The deletion had run in the background for about eight hours, from 11:02 to 19:40 UTC, without a single alarm. The Logs cluster moves data parts to S3 only after 24 hours and most queries read recent logs, so query errors stayed few. Alerts covered ingestion lag, query latency and error rates on active queries, nothing measured the integrity of the older data on S3, and the deletion raised no application-level errors, so dashboards stayed green until the node restart forced a consistency check.
Symptom Data loss
Root cause
Root cause Software defect
- Trigger
- At 10:54 UTC a routine mutation was run to materialise an index. When it finished at 11:02, it set off a bug in ClickHouse's zero-copy replication.
Detection
No automated alarm fired. At 19:40 UTC a node in the cluster crashed, restarted and failed to start because of the missing data, and the engineers who investigated found that most of the S3-backed data was gone.
Remediation
- Switched Logs to a new table without zero-copy replication and caught up on recent messages
- Backfilled the Logs data from the 3 days of Kafka history
Action items
- Disable zero-copy replication on all clusters
- Audit the whole Logs ClickHouse configuration and keep experimental features out of production
- Enable S3 versioning on the storage buckets so objects deleted by a database bug can be recovered
- Spot-check configurations and data integrity strategies for single points of failure before a product becomes generally available
Lessons
Running Logs in its own cluster kept every other product unaffected, and 3 days of Kafka retention saved the recent data. An experimental setting chosen for an early internal stage was allowed to stay in production. Monitoring covered only incoming and recent data, so petabytes were deleted over 8 hours without an alarm. Relying on database replication alone over shared storage was a single point of failure, and S3 versioning would have let the deleted files be recovered.
Sources
Related cases
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, Database replication
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, Database backups and snapshots
IL-0589Every Kickstarter MySQL replica on Amazon RDS stopped replicating on a duplicate-key error in the backings tableKickstarter · 2013same root cause · shared Database, Database replication
IL-0303GitHub's MySQL master failed over to a node with a cold buffer pool during a schema migration and GitHub.com went downGitHub · 2012same root cause · shared Database, Database replication
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-0310An Aurora PostgreSQL failover to an upsized reader reversed twice and backend writes failed in read-only transactionsHightouch · 2025same 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-0535An internal Kinesis Data Streams cell in US-EAST-1 degraded, raising errors in CloudWatch Logs, S3 events and LambdaAmazon Web Services · 2024same root cause · shared Object storage
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-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-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
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
Check your cluster for this
For AI tools and scripts
- This case as JSON: https://incidentlib-api.benchlet.com/cases/IL-0281
- The cases most like it: https://incidentlib-api.benchlet.com/cases/IL-0281/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.