IL-0318 Clerk · 2026-03-10databasegcp
Clerk's APIs went down with lock contention and 429s while a Google Cloud SQL live migration slowed its database disk
Clerk runs Postgres on Google Cloud SQL Enterprise Plus with high availability. Cloud SQL performs live migrations of its virtual machines on a routine basis, without telling Clerk in advance, and when they work they do not affect availability. On 10 March 2026 a live migration did not work as expected: disk latency on Clerk's database rose sharply, lock contention followed, and the service went down completely. Clerk enabled Origin Outage Mode at 16:10 UTC to keep session management working. At 16:23 the problem ended on its own when the migration completed, Clerk turned Origin Outage Mode off shortly after, and GCP later told Clerk the cause.
This was not the first such failure. In September 2025 a different live migration had caused a major Clerk incident, from which Clerk learned that a failed live migration causes downtime until it completes and that a replica failover during one is unsafe. Google escalated that ticket to P0 and pinned the database to its datacenter so no further live migrations would run. Over the following months, with weekly calls and over 80 Google staff involved, Clerk worked, at Google's guidance, on reducing its average queries per request, introducing Google's managed connection pooler and increasing the Postgres version, while Google looked for the issue in its live migration process. The database was unpinned in January, and the first live migration after that succeeded with both teams on a call.
- Severity
- –
- Scope
- Clerk's APIs: increased latency, 5xx errors and then 429 responses, and a complete service outage; session management kept working from 16:10 UTC through Origin Outage Mode
- Users affected
- Clerk customers and the users of their applications
- Region
- –
- Time to detect
- 1m
- Time to resolve
- 27m
Symptoms
At 15:57 UTC on 10 March 2026, Clerk's alerting reported increased latency and elevated 5xx errors across its APIs, and the incident was declared. Monitoring showed increased lock contention in the database, which had started about a minute earlier.
The database stayed up with CPU usage within normal limits, but queries and transactions took far longer to complete, which saturated Clerk's compute resources, and incoming requests began returning 429. Session outage resiliency triggered automatically at origin to keep serving session token requests, but because compute was already saturated most of those requests got 429 as well. The 429 came straight from an internal service instead of being turned into a 500.
There was no clear cause at first. Moving all reads to the replicas to relieve the primary did not help. During the investigation the team saw elevated IO wait on reads without a matching increase in writes, suspected an infrastructure problem and opened a ticket with GCP.
Symptom High latencyHigh error rateLock contention or deadlockService outage
Root cause
Root cause Cloud provider outage
- Trigger
- A routine live migration of the Google Cloud SQL virtual machine that hosts Clerk's Postgres database, done without advance notice to Clerk, did not work as intended.
Detection
Alerting reported increased latency and elevated 5xx errors across the APIs at 15:57 UTC, and monitoring showed lock contention in the database that had begun about a minute earlier.
Remediation
- Enabled Origin Outage Mode to keep session management working
- Opened a ticket with GCP after seeing elevated IO wait on reads
- Disabled Origin Outage Mode after the live migration completed and the system stabilised
Action items
- Ask Google to pin the database again to stop further live migrations
- Use replica promotion instead of live migrations for all Postgres database maintenance
- Move to another database provider or run Postgres in-house unless Google offers a way to disable live migrations permanently
- Return 500 instead of the internal service's 429 so applications can tell the state of Clerk's systems from the error code
- Shift most of the engineering team to reliability-focused projects
Lessons
Clerk concludes that Cloud SQL live migrations are still unsafe after months of joint work with Google, and that they are opaque, leaving Clerk to trust Google's word. Clerk prefers traditional replica promotion for all Postgres maintenance, an automated process it had already used without incident for a Postgres major version upgrade on January 17, 2026.
Sources
Related cases
IL-0322A GCP storage incident degraded the disk under GitLab.com's primary PostgreSQL and caused two bursts of site-wide 503sGitLab · 2026 · sev1same root cause · shared Database
IL-0368PlanetScale's control plane went down and some database branches failed queries during the AWS us-east-1 outagePlanetScale · 2025same root cause · shared Database
IL-0284Workers KV failed 90.22% of requests in a third-party storage outage, breaking Access, WARP and many Cloudflare productsCloudflare · 2025same root cause · shared Database
IL-0119ChatGPT web service pods crash-looped on failing health checks after a Cosmos DB failure, leaving too few healthy pods to serve the web layerOpenAI · 2025same root cause · shared Database
IL-0145A power sag and chiller failure in one Australia East availability zone took down the AKS control plane's compute and its non-zone-redundant SQL Database operation queue, blocking AKS create, update and delete operations in Australia East and Australia SoutheastMicrosoft Azure · 2023same root cause · shared Database
IL-0488Kit's RDS MySQL write latency rose 100x and running threads jumped from 9 to 900, backing up Sidekiq job queuesKit · 2022same root cause · shared Database
IL-0172An AWS Tokyo data centre cooling failure took down 6 of 60 CockroachDB nodes on Kubernetes within 22 minutes, and ranges lost quorum because the Helm-deployed cluster had no availability zone locality configuredDevsisters · 2021same root cause · shared Database
IL-0193A GCP persistent disk degradation took down a Cassandra StatefulSet whose OrderedReady policy blocked recovery, and Metrictank could not reconnect to the recreated pods, causing a 23-hour Graphite query outageGrafana Labs · 2019same 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-0318
- The cases most like it: https://incidentlib-api.benchlet.com/cases/IL-0318/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.