Video summary

It's 2 AM...Production is Down

Main summary

Key takeaways

Technology

Summary

At 2 a.m., an on-call engineer received an alert that the production API’s error rate had exceeded 80%. Servers and Kubernetes pods appeared healthy, and PostgreSQL responded to direct queries, but customers could not place orders. Application logs showed repeated timeouts while waiting for database connections.

What happened

  • The application’s connection pool was nearly full. An autoscaler had doubled the number of application pods, increasing demand on a database already at its connection limit.
  • Inspecting PostgreSQL sessions revealed many requests waiting on locks.
  • A scheduled schema migration—an ALTER TABLE adding a column to orders—was waiting for an exclusive lock. While it waited, other requests queued behind it.
  • The lock was held by a reporting task that had opened a transaction but failed to close it. Its session was idle in transaction: it was no longer doing useful work but still held the lock.

Response and recovery

The engineer stopped the autoscaler, identified the blocking migration, verified its process, and canceled the request. Once the migration was removed from the queue, pending connections began to drop and the API recovered. The reporting transaction was then cleared.

Lessons and follow-up

The incident resulted from several individually routine events interacting: an unclosed transaction, a schema migration requiring an exclusive lock, and an autoscaler adding database demand.

The team disabled automatic migration retries, planned a fix for the reporting script’s transaction handling, and decided to change how migrations are run so they cannot block production traffic indefinitely. The engineer also documented the outage and its cause for follow-up.

Main speakers and sources

The on-call engineer narrates the incident. Daniel, a backend engineer, helps investigate, while an engineering manager asks for the root cause and a debrief. Technical evidence comes from application logs, Grafana, Kubernetes status, and PostgreSQL session and lock information.

Rate this summary

Your feedback will help improve summaries.

Improve this summary

Reprocess with a stronger model when the summary feels incomplete or inaccurate.

Pro

Translate summary in another language

Pro

Ask questions to this video

Chat for follow-up questions, clarifications, and source-backed answers.

Coming soon

Share this summary

Original video