diff --git a/server/modules/routing/readwritesplit/readwritesplit.cc b/server/modules/routing/readwritesplit/readwritesplit.cc index ffae857c4..33341770e 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.cc +++ b/server/modules/routing/readwritesplit/readwritesplit.cc @@ -228,28 +228,6 @@ RWSplit* RWSplit::create(SERVICE* service, MXS_CONFIG_PARAMETER* params) return NULL; } - /** These options cancel each other out */ - if (config.disable_sescmd_history && config.max_sescmd_history > 0) - { - config.max_sescmd_history = 0; - } - - if (config.optimistic_trx) - { - // Optimistic transaction routing requires transaction replay - config.transaction_replay = true; - } - - if (config.transaction_replay) - { - /** - * Replaying transactions requires that we are able to do delayed query - * retries and reconnect to a master. - */ - config.delayed_retry = true; - config.master_reconnection = true; - } - return new(std::nothrow) RWSplit(service, config); } diff --git a/server/modules/routing/readwritesplit/readwritesplit.hh b/server/modules/routing/readwritesplit/readwritesplit.hh index 42c74281b..b5c36ea52 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.hh +++ b/server/modules/routing/readwritesplit/readwritesplit.hh @@ -172,6 +172,28 @@ struct Config { retry_failed_reads = true; } + + /** These options cancel each other out */ + if (disable_sescmd_history && max_sescmd_history > 0) + { + max_sescmd_history = 0; + } + + if (optimistic_trx) + { + // Optimistic transaction routing requires transaction replay + transaction_replay = true; + } + + if (transaction_replay) + { + /** + * Replaying transactions requires that we are able to do delayed query + * retries and reconnect to a master. + */ + delayed_retry = true; + master_reconnection = true; + } } select_criteria_t slave_selection_criteria; /**< The slave selection criteria */