MXS-1506: Add delayed_retry parameter

By adding a boolean parameter, the feature can be enabled with sensible
default values. Renamed the query_retry parameters and set the defaults to
acceptable values.

Added new parameters to diagnostic output. Also did some minor renaming.
This commit is contained in:
Markus Mäkelä
2018-04-05 17:25:03 +03:00
parent 4786d88413
commit 1ab8f7a4bf
4 changed files with 27 additions and 18 deletions

View File

@ -241,13 +241,15 @@ bool RWSplitSession::route_single_stmt(GWBUF *querybuf, const RouteInfo& info)
else if (can_retry_query())
{
// Try to route the query again later
uint64_t interval = m_config.query_retry_interval;
uint64_t interval = m_config.delayed_retry_interval;
MXS_SESSION* session = m_client->session;
session_delay_routing(session, router_as_downstream(session),
gwbuf_clone(querybuf), interval);
m_retry_duration += interval;
succp = true;
// Increment by at least one to prevent infinite delay
m_retry_duration += interval > 0 ? interval : 1;
MXS_INFO("Will try to route query again in %lu seconds", interval);
}
}