Skip to content

Metadata store outage

This applies when the metadata database (Cloud SQL or AlloyDB) can’t be reached, is failing over, or is very slow.

Path During the outage
Publish Keeps working for topics the pod has seen in the last few seconds. Publishes go to the WAL, which doesn’t need the database. A publish to a topic the pod has not seen recently fails with UNAVAILABLE.
Messages already accepted Safe in the WAL. Their upload to Cloud Storage succeeds, but recording it in the index fails, so the pod retries (backoff up to 10 seconds) and WAL files pile up. Once lowtide_pending_upload_bytes reaches the pending-upload cap, the pod refuses publishes with UNAVAILABLE so the disk can’t fill.
Delivery Continues for messages that can be read without the index: a pod’s own stream from memory and same-zone peers’. Reads that need the index (the other zone, subscribers that lag) stall.
Acks Applied in memory. Recording the acknowledgement position fails and is retried every second. If a pod dies before it succeeds, those messages are delivered again.
Leases The current pod keeps serving its shards. Their leases expire meanwhile, so when the database returns, another pod may take over a shard. Expect a burst of redeliveries.
Creating resources, admin calls, proxying to another pod, dead-lettering Fail with UNAVAILABLE. Dead-lettering retries every 5 seconds.
Pod start Fails. A starting pod retries the connection 30 times about a second apart, then exits. It also needs the database to register its stream, so it crash-loops and never becomes ready.

The Terraform module’s database connection has connect and TCP timeouts (connect_timeout=5&keepalives_idle=30&tcp_user_timeout=30000). If you install with Helm, add them to your DSN, or a network that silently drops packets can make calls hang instead of failing.

  1. Don’t restart, roll out or drain gateway pods while the database is down: new pods can’t start. Pause anything that would, such as GKE node auto-upgrades or a running deployment.
  2. Restore the database, or let the high-availability failover finish. Broken connections are replaced on their next use.
  3. Watch recovery. It is automatic: uploads drain in order, acknowledgement positions catch up, publishes to every topic work again. lowtide_pending_upload_bytes falls back to normal and lowtide_upload_errors_total stops rising.
  4. Pods in CrashLoopBackOff recover on their next attempt. kubectl -n lowtide delete pod POD skips the wait.
  5. Expect duplicates from redelivery and moved shards. This is within lowtide’s at-least-once delivery.

If a pod still reports database errors several minutes after the database is back, restart it.