The use of a pointer instead of a reference conveys the message that the
lifetime of the object being pointed can, and most likely will, exceed the
lifetime of the function.
Also shuffled the member variables and internal functions around and
removed unneeded function declarations.
Cleaned up the headers, removed unused structures. Changed some members to
strings instead of char arrays. Switch to router templates should now be
easier.
The sharding implementation now uses a class to abstract the details of
the shard. This allows for different design where each session makes a
copy of the global shard map which is then used for the duration of the
session. In addition to making the desing a bit clearer to understand, it
also removes lock competition between threads.
Due to the change to C++, the main entry points need to be wrapped in the
exception-safety macros. The next step in the refactoring will be to use
the router template. This will remove the need to manually define them.
The schemarouter now uses the new session commands. It uses a standard
library container to manage the execution and storage of session commands.
The session command history is disabled until a more complete refactoring
can be done.
Some of the protocol modules use ssize_t instead of size_t.
Split the function that counts the number of response packets a session
command will receive into two parts. This allows it to be reused
elsewhere.
The binlogrouter error handling closed the DCB twice. This was caused by
the change in the way the DCB error handling is done.
The protocol modules now also call the error handling routine even if the
router session is NULL. This enables the binlogrouter to manage
authentication failures correctly instead of trying to reconnect again.
Previously, MaxAdmin would interpret any non-option words in the
command line as either a filename or, if the file could not be opened,
as MaxAdmin commands. This made it possible to mix filenames and
commands if there was a matching filename in the folder. For example
"maxadmin show services" would read commands from a file named
"show services" if it existed. This update removes this feature. To
read commands from a file, use either shell redirection "maxadmin <
mycommands" or the "source"-command inside maxadmin.
General code cleanup. Routing error detection now more robust.
Remove some unused code. Debug messages now use "unique_name" when
referring to servers.
Supports hint types:
-master
-slave
-named server
-all
A default action, which is performed when no hint exists or on error,
can be set. The different actions are analogous to the hint types.
A maximum connection number for slaves can be set. If more slaves are
configured for the service, the filter will rotate slaves for new sessions.
Within a session with multiple slaves, the "route_to_slave"-hint will
also rotate among the slave backends.
The readwritesplit now sends COM_PING queries to backend servers that have
been idle for too long. The option is configured with the
`connection_keepalive` parameter.