Remove unnecessary SConfig from readwritesplit

The configuration doesn't need to be contained in shared pointer as each
session holds its own version of it. This removes most of the overhead in
configuration reloading. The only thing that's left is any overhead added
by the use of thread-local storage.
This commit is contained in:
Markus Mäkelä
2018-08-01 10:25:15 +03:00
parent 403b9e09f5
commit c01840ffb3
7 changed files with 116 additions and 117 deletions

View File

@ -134,7 +134,7 @@ public:
mxs::SRWBackend m_current_master; /**< Current master server */
mxs::SRWBackend m_target_node; /**< The currently locked target node */
mxs::SRWBackend m_prev_target; /**< The previous target where a query was sent */
SConfig m_config; /**< Configuration for this session */
Config m_config; /**< Configuration for this session */
int m_nbackends; /**< Number of backend servers (obsolete) */
DCB* m_client; /**< The client DCB */
uint64_t m_sescmd_count; /**< Number of executed session commands */
@ -253,14 +253,14 @@ private:
*
* @see handle_trx_replay
*/
return m_config->delayed_retry &&
m_retry_duration < m_config->delayed_retry_timeout &&
return m_config.delayed_retry &&
m_retry_duration < m_config.delayed_retry_timeout &&
!session_trx_is_active(m_client->session);
}
inline bool can_recover_servers() const
{
return !m_config->disable_sescmd_history || m_recv_sescmd == 0;
return !m_config.disable_sescmd_history || m_recv_sescmd == 0;
}
inline bool is_large_query(GWBUF* buf)