From 391618d53be2cafbfefc0c0b3b40e76e5dd6b5f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Sun, 24 Jun 2018 10:50:12 +0300 Subject: [PATCH] MXS-1549: Add documentation for optimistic_trx Added parameter documentation and explained the limitations it has. --- Documentation/Routers/ReadWriteSplit.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Documentation/Routers/ReadWriteSplit.md b/Documentation/Routers/ReadWriteSplit.md index a54d2cfe7..b403bab01 100644 --- a/Documentation/Routers/ReadWriteSplit.md +++ b/Documentation/Routers/ReadWriteSplit.md @@ -391,6 +391,29 @@ that exceeds this limit will not be replayed. The default size limit is 1 MiB. Read [the configuration guide](../Getting-Started/Configuration-Guide.md#sizes) for more details on size type parameters in MaxScale. +### `optimistic_trx` + +Enable optimistic transaction execution. This parameter controls whether normal +transactions (i.e. `START TRANSACTION` or `BEGIN`) are load balanced across +slaves. This feature is disabled by default and enabling it implicitly enables +`transaction_replay`, `delayed_retry` and `master_reconnection` parameters. + +When this mode is enabled, all transactions are first attempted on slave +servers. If the transaction contains no statements that modify data, it is +completed on the slave. If the transaction contains statements that modify data, +it is rolled back on the slave server and restarted on the master. The rollback +is initiated the moment a data modifying statement is intercepted by +readwritesplit so only read-only statements are executed on slave servers. + +As with `transaction_replay` and transactions that are replayed, if the results +returned by the master server are not identical to the ones returned by the +slave up to the point where the first data modifying statement was executed, the +connection is closed. If the execution of ROLLBACK statement on the slave fails, +the connection to that slave is closed. + +All limitations that apply to `transaction_replay` also apply to +`optimistic_trx`. + ### `causal_reads` Enable causal reads. This parameter is disabled by default and was introduced in