MXS-2196: Remove the dummy session

As each connection now immediately gets a session the dummy session is no
longer required. The next step would be to combine parts of the session
and the client DCB into one entity. This would prevent the possibility of
a client DCB with no associated session. Backend DCBs are different as
they can move from one session to another when the persistent connection
pool is in use.
This commit is contained in:
Markus Mäkelä
2018-12-03 13:18:42 +02:00
parent a2f5cc9d09
commit 692127a2cb
9 changed files with 70 additions and 161 deletions

View File

@ -774,8 +774,7 @@ static int gw_read_do_authentication(DCB* dcb, GWBUF* read_buffer, int nbytes_re
*/
if (session_start(dcb->session))
{
mxb_assert(dcb->session->state != SESSION_STATE_ALLOC
&& dcb->session->state != SESSION_STATE_DUMMY);
mxb_assert(dcb->session->state != SESSION_STATE_ALLOC);
// For the time being only the sql_mode is stored in MXS_SESSION::client_protocol_data.
dcb->session->client_protocol_data = QC_SQL_MODE_DEFAULT;
protocol->protocol_auth_state = MXS_AUTH_STATE_COMPLETE;
@ -1464,8 +1463,7 @@ static int gw_client_close(DCB* dcb)
{
MXS_SESSION* target = dcb->session;
if (target->state != SESSION_STATE_TO_BE_FREED
&& target->state != SESSION_STATE_DUMMY)
if (target->state != SESSION_STATE_TO_BE_FREED)
{
mxb_assert(target->state == SESSION_STATE_ROUTER_READY
|| target->state == SESSION_STATE_STOPPING);
@ -1492,7 +1490,7 @@ static int gw_client_hangup_event(DCB* dcb)
if (session)
{
if (session->state != SESSION_STATE_DUMMY && !session_valid_for_pool(session))
if (!session_valid_for_pool(session))
{
if (session_get_dump_statements() == SESSION_DUMP_STATEMENTS_ON_ERROR)
{