diff --git a/server/modules/routing/readwritesplit/rwsplitsession.cc b/server/modules/routing/readwritesplit/rwsplitsession.cc index 3d18187b7..add7ba302 100644 --- a/server/modules/routing/readwritesplit/rwsplitsession.cc +++ b/server/modules/routing/readwritesplit/rwsplitsession.cc @@ -720,7 +720,7 @@ bool RWSplitSession::lock_to_master() bool RWSplitSession::is_locked_to_master() const { - return m_target_node && m_target_node == m_current_master; + return m_current_master && m_target_node == m_current_master; } bool RWSplitSession::supports_hint(HINT_TYPE hint_type) const diff --git a/server/modules/routing/readwritesplit/rwsplitsession.hh b/server/modules/routing/readwritesplit/rwsplitsession.hh index 92c9d6b55..9ebc0e1aa 100644 --- a/server/modules/routing/readwritesplit/rwsplitsession.hh +++ b/server/modules/routing/readwritesplit/rwsplitsession.hh @@ -180,16 +180,6 @@ private: void handle_error_reply_client(DCB *backend_dcb, GWBUF *errmsg); bool handle_error_new_connection(DCB *backend_dcb, GWBUF *errmsg); - /** - * Check if the session is locked to the master - * - * @return Whether the session is locked to the master - */ - inline bool locked_to_master() const - { - return m_qc.large_query() || (m_current_master && m_target_node == m_current_master); - } - private: // QueryClassifier::Handler bool lock_to_master();