25 Commits

Author SHA1 Message Date
Marko
7893c120a9 MXS-2477 Change schemarouter ignore_databases parameters to ignore_tables
With the table level sharding parameter is used to ignore tables not
databases.
2019-05-21 13:48:17 +03:00
Johan Wikman
aa3057695b MXS-2329 Use durations in schema router 2019-04-30 13:02:53 +03:00
Esa Korhonen
900cbb4cff MXS-2304 Move last config_get_x() functions inside class 2019-03-04 12:27:36 +02:00
Esa Korhonen
5ab7734e9d MXS-2304 Add contains() to test if a parameter exists
Replaces uses of config_get_param() in modules either with contains()
or get_string(). The config_get_param() is moved to internal headers,
as it allows seeing inside a config setting.
2019-02-06 12:36:23 +02:00
Esa Korhonen
3eb7d89c80 MXS-2304 Use get_service() and get_server() 2019-02-01 17:31:41 +02:00
Esa Korhonen
b357717149 MXS-2304 Use get_bool() instead of config_get_bool() 2019-02-01 17:18:49 +02:00
Esa Korhonen
c8a84cebd0 MXS-2304 Use get_integer() instead of config_get_integer() 2019-01-31 18:12:25 +02:00
Niclas Antti
c447e5cf15 Uncrustify maxscale
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
2018-09-09 22:26:19 +03:00
Markus Mäkelä
a252b45f18
Don't use auto&& in non-template code
Use explicit types instead.
2018-08-06 21:20:29 +03:00
Markus Mäkelä
5903e194a7
Add runtime schemarouter reconfiguration
The schemarouter now also uses versioned configurations implemented by
shared pointers to configuration objects. Moved all the configuration
management into the Config class. Removed router options from
schemarouter.
2018-07-11 14:08:52 +03:00
Johan Wikman
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
Markus Mäkelä
bbfd9ce136 Move Backend and SessionCommand classes to the core
Using the same implementation of the Backend and SessionCommand classes in
both schemarouter and readwritesplit will prevent duplication of code.

This commit only splits the generic parts of the class to a Backend class
which the schemarouter then extends. The session commands for both routers
are similar so they require no special handling.
2017-06-22 10:40:16 +03:00
Johan Wikman
f546a17e77 Update change date of 2.2 2017-06-01 10:24:20 +03:00
Markus Mäkelä
2310381465 Make variables of Backend private
The variables are no longer directly manipulated by the session level
code.
2017-04-06 09:22:21 +03:00
Markus Mäkelä
0d7f987598 Move state checks inside the Backend class
The class now has methods to query its internal state.
2017-04-06 09:22:20 +03:00
Markus Mäkelä
6e218adc1d Make connections and command queues internal to Backends
The SERVER_REF and DCB members of the Backend class are now
private. Access to the stored SERVER_REF is provided with the backend()
function. No accompanying setter function is provided as the backend
server should not change during the lifetime of the session.

The creation of the internal DCB is hidden behind the connect()
function. It simplifies the process of connecting to a server by removing
the need to manually do the bookkeeping of the server reference connection
counts. Access to the DCB is provided by the dcb() function.

The closing of the backend is done with the close() function which
contains the code that was previously in closeSession. If the backend
isn't closed when the destructor is called, it will be done
automatically. This should prevent connection leakage.

The pending command queues and the methods used to write them are now also
internal to the backends. They are simple wrappers around dcb->func.write
and the interfaces provided by the Buffer class. The mapping command queue
is still public. It needs to be combined with the generic command queue.
2017-03-31 14:12:02 +03:00
Markus Mäkelä
66fa4fbc7d Use shared pointers to Backend classes
The schemarouter now uses shared pointers. This removes the need to copy
the class.

Following changes move the member variables inside the Backend class.
2017-03-31 14:12:02 +03:00
Markus Mäkelä
ac641e0f22 Use router template in schemarouter
The schemarouter now uses the router template.
2017-03-31 14:12:00 +03:00
Markus Mäkelä
b2ff0c5a0f Clean up schemarouter headers
Cleaned up the headers, removed unused structures. Changed some members to
strings instead of char arrays. Switch to router templates should now be
easier.
2017-03-31 14:12:00 +03:00
Markus Mäkelä
d151512d20 Take new sharding implementation into use
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.
2017-03-31 14:12:00 +03:00
Markus Mäkelä
9587b2ecfc Remove unused schemarouter code
The temporary table detection in schemarouter was not used.
2017-03-31 14:12:00 +03:00
Markus Mäkelä
bda0fd2db0 Replace session command implementation
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.
2017-03-31 14:12:00 +03:00
Markus Mäkelä
d8abefff5f Add session command class
The class abstracts the session commands and the lists of session commands
using standard library containers.
2017-03-31 14:12:00 +03:00
Markus Mäkelä
9e4e70a337 Move shard map handling into a separate file
Moved the handling of shard maps into another file.
2017-03-31 14:12:00 +03:00
Markus Mäkelä
a5fd53e9a0 Compile schemarouter as C++
Compile schemarouter as C++ so that refactoring into more coherent parts
is easier.
2017-03-31 14:12:00 +03:00