Home / Companies / PlanetScale / Blog / Post Details
Content Deep Dive

How one connection kills a database

Blog post from PlanetScale

Post Details
Company
Date Published
Author
-
Word Count
995
Company Posts That Month
7
Language
English
Hacker News Points
-
Post removed?
No
Summary

A single uncommitted database transaction can cause widespread downtime when it holds a lock that blocks a schema migration, which then queues all subsequent queries behind it; this behavior can occur in both MySQL and PostgreSQL without a deadlock or automatic timeout. The example describes an application exception leaving a PostgreSQL transaction open after a read query, preventing an ALTER TABLE operation from obtaining its required exclusive lock and causing later queries against the table to stall. Setting PostgreSQL’s idle_in_transaction_session_timeout can help prevent such incidents by closing inactive transactions. To simplify diagnosis and recovery, PlanetScale has introduced dashboard and CLI tools for viewing active MySQL and PostgreSQL connections, identifying blocked queries, inspecting connection details, and canceling queries, terminating transactions, or dropping connections, including through reserved administrative capacity when normal connection slots are exhausted.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.