Delayed Retrying of Failed Queries with MaxScale's Read/Write Split Router
The Read/Write Split Router (readwritesplit) routes write queries to the primary server and load balances read-only queries between one or more replica servers. If a server fails, then the router may need to retry failed queries on a different server. The retry may need to be delayed in some cases, such as when automatic failover is in progress.
Configuring Delayed Retries for Failed Queries
Configure delayed retries for failed queries by configuring several parameters for the Read/Write Split Router in
When this parameter is enabled, failed queries will not immediately return an error to the client. Instead, the router will retry the query if a different server becomes available before the timeout is reached.
This parameter is disabled by default.
The maximum amount of time to wait until returning an error if a query fails.
The value can be followed by any of the following units:
ms, for specifying durations in hours, minutes, seconds, and milliseconds.
The default value is 10 seconds.
[split-router] type = service router = readwritesplit ... delayed_retry = true delayed_retry_timeout = 30s
Restart the MaxScale instance.
$ sudo systemctl restart maxscale