When the `optimistic_trx` mode is enabled, all transactions are started on a slave server. If the client executes a query inside the transaction that is not of a read-only nature, the transaction is rolled back and replayed on the master.