MXS-2822: Use both last_write and last_read

The code relied on last_read for the idle time calculation which caused
the pings that were written to not reset the idle time. This increased the
chance of multiple COM_PING packets being sent to a backend before a reply
was received.
This commit is contained in:
Markus Mäkelä 2020-02-12 07:57:42 +02:00
parent 8b763fb88b
commit 3fc20d4345
No known key found for this signature in database
GPG Key ID: 5CE746D557ACC499

View File

@ -51,7 +51,7 @@ void RWSplitSession::handle_connection_keepalive(RWBackend* target)
if (backend->in_use() && backend != target && !backend->is_waiting_result())
{
MXB_AT_DEBUG(nserv++);
int64_t diff = now - backend->dcb()->last_read;
int64_t diff = now - std::max(backend->dcb()->last_read, backend->dcb()->last_write);
if (diff > keepalive)
{