Readwritesplit now uses the SessionCommand class as a "master list" of
executed session commands. This allows the session commands to be easily
copied over to slaves that are taken into use after session commands have
already been executed.
Currently, the code doesn't execute the session command history when a
mid-session reconnection occurs. A method to cleanly copy the session
commands needs to be exposed by the Backend class.
Removed old router property code as it is no longer needed when
SessionCommand class used by the Backend class is taken into use.
Removed unnecessary code that is implemented as a part of the Backend
class.
Changed functions to return references to Backends instead of handling raw
DCBs. This introduces a few cases where the code returns a reference when
no reference is actually available. These cases are solved by having an
empty static shared_ptr that is returned in these cases. This is done to
silence any compiler warnings that returning references to local variables
would bring as these should never happen if the code is functioning
properly.
This is the first step to taking the Backend class into use. It is now
used in rwsplit_select_backends.cc and readwritesplit.hh. The module is
not yet functional and doesn't even compile.
Added some helper functions to the Backend class to get easier access to
the server referenced by the SERVER_REF and to check the state of the
backend.
Creating duplicate connections using the Backend class allows the
connections and their handling to be tested at the same time that the old
system is in place. This should make it somewhat easier to grasp what
changes and where when the new implementation is taken into use.
The session commands are now duplicated as SessionCommand objects This
allows for an easier migration from the old session command implementation
to the new one.
Reorganized the main source file of readwritesplit. The internal functions
are first followed by the API entry points. The actual module definition
is the last declared object in the file.
The temporary table detection and handling now uses C++ containers to
store the set of temporary tables. The detection also uses the new query
classifier field info API to detect which tables and databases are
targeted.