Oriel — AI & technology worth noticing, every day.

Inside Hyperdrive: How we solved a rare Hyperdrive MySQL caching bug

Web page · https://blog.cloudflare.com/hyperdrive-mysql

While adding MySQL support to Hyperdrive, we found a subtle protocol bug when caching query results. Here is how we tracked down a 0.001% rate error and made Hyperdrive MySQL generally available.

First seen by Oriel on .

AI summary

Cloudflare describes the MySQL caching bug fixed before Hyperdrive’s general availability, caused by incompatible cached response formats between Client and Endpoint nodes sharing a datacenter cache.

  • Hyperdrive pools warm MySQL connections globally and optionally caches query results, with Client and Endpoint nodes using local datacenter CDN caches.
  • MySQL capability negotiation can change result-set termination, requiring Hyperdrive to translate EOF and OK packets for Worker client libraries such as mysql2.
  • The bug affected roughly 0.001% of requests when Client and Endpoint shared a cache and read responses written in incompatible capability formats.
  • Hyperdrive now stores canonical query-result bytes encoded with Hyperdrive’s capabilities, eliminating empty responses and raising Client connection success to 99.99%.
  • MySQL support is generally available through the dashboard, wrangler, or PlanetScale connections.

#cloudflare hyperdrive #mysql #database caching #connection pooling

Generated by gpt-5.6-sol. Check the original for details.

Aliases

SourceExternal IDURL
Cloudflare Blog01M4VK1MXKAPMWG5QXYBFK222Ghttps://blog.cloudflare.com/hyperdrive-mysql/ Read discussion