MXS-2196: Split session startup into two parts

The session allocation now has two distinct parts: the initialization of
the session itself and the creation of the router and filter
sessions. This allows sessions to be allocated the moment a client DCB is
created instead of only after the authentication is complete. With this
change, the need for the dummy session is removed.
This commit is contained in:
Markus Mäkelä
2018-12-03 08:45:00 +02:00
parent 13769a0e8c
commit 180e150ba1
2 changed files with 65 additions and 80 deletions

View File

@ -303,6 +303,19 @@ MXS_SESSION* session_alloc(SERVICE*, DCB*);
*/
MXS_SESSION* session_alloc_with_id(SERVICE*, DCB*, uint64_t);
/**
* Start the session
*
* Called after the session is initialized and authentication is complete. This creates the router and filter
* sessions.
*
* @param session Session to start
* @param service The service where the session is started
*
* @return True if session was started successfully
*/
bool session_start(MXS_SESSION* session, SERVICE* service);
MXS_SESSION* session_set_dummy(DCB*);
static inline bool session_is_dummy(MXS_SESSION* session)