HeadlinesBriefing favicon HeadlinesBriefing.com

Tailscale Traces SQLite Corruption to 16-Year-Old Bug

Hacker News •
×

At the end of last year, Tailscale's uptime suffered due to a single bug deep in SQLite. Over six months, they faced 19 separate database corruption incidents. The bug was a 16-year-old SQLite WAL-reset flaw. Tailscale uses SQLite as its primary database since 2022. Corruption caused control plane downtime, affecting tailnets' ability to learn network changes, though devices already connected remained linked. The recovery process initially took over an hour but was sped up through automation.

Tailscale's engineers, with help from SQLite developers, systematically ruled out theories like broken POSIX locks or multiple-thread misuse. They built a transaction logging pipeline to restore service without rolling back to old backups. Eventually, they traced the corruption to the long-standing SQLite bug. The fix has been deployed, and Tailscale is now confident in its reliability. They apologized for the disruption and detailed their forensic journey in a blog post.