MXS-2141: Retry query on master if it times out on slave

With causal_reads enabled, the query would return with an error if the
slave was not able to catch up to the master fast enough. By automatically
retrying the query on the master, we're guaranteed that a valid result is
always returned to the client.
This commit is contained in:
Markus Mäkelä
2018-11-06 12:25:57 +02:00
parent c661f5e838
commit e56372b153
4 changed files with 34 additions and 6 deletions

View File

@ -477,11 +477,11 @@ SELECT * FROM test.t1 WHERE id = 1;
The `SET` command will synchronize the slave to a certain logical point in
the replication stream (see
[MASTER_GTID_WAIT](https://mariadb.com/kb/en/library/master_gtid_wait/)
for more details). If the slave has not caught up to the master within the
configured time, an error will be returned. To the client side
application, this will appear as an error on the statement that they were
performing. This is caused by the fact that the synchronization command is
executed with the original command as a multi-statement command.
for more details).
If the slave has not caught up to the master within the configured time, it will
be retried on the master. In MaxScale 2.3.0 an error was returned to the client
when the slave timed out.
### `causal_reads_timeout`