readysettech / readyset

Readyset is a MySQL and Postgres wire-compatible caching layer that sits in front of existing databases to speed up queries and horizontally scale read throughput. Under the hood, ReadySet caches the results of cached select statements and incrementally updates these results over time as the underlying data changes.
https://readyset.io
Other
4.54k stars 125 forks source link

forward COM_PING to MySQL #1387

Closed altmannmarcelo closed 4 weeks ago

altmannmarcelo commented 1 month ago

Description

COM_PING is used to check if a connection is still open and reset it's wait/interactive_timeout.

Currently we are able to read COM_PING and return an OK_PACKET back, but we should also send a COM_PING in the upstream connection attached to the connection that received COM_PING in order to refresh the timeout on the upstream connection.

Change in user-visible behavior

Requires documentation change

altmannmarcelo commented 1 month ago
Screenshot 2024-10-09 at 13 26 26

When we receive a COM_PING (port 3307) we don't send it to MySQL (Port 3306) we just reply back with an OK_PACKET.

After the patch:

Screenshot 2024-10-09 at 14 04 14

We know receive a ping and send it to MySQL

altmannmarcelo commented 4 weeks ago
2024-10-24T16:49:43.462011Z ERROR connection{addr=X.X.X.X:36392}: readyset_mysql::backend: encountered io error while attempting to execute query err=connection closed
2024-10-24T16:49:43.462265Z ERROR connection{addr=X.X.X.X:36392}: readyset::mysql: connection lost err=connection closed