190 Commits

Author SHA1 Message Date
Markus Mäkelä
67590d59ac Fix connector_plugindir usage with basedir
The connector_plugindir wasn't set correctly when basedir was used.
2017-03-15 17:37:25 +02:00
Johan Wikman
0985a18a7e Perform internal qc initialization 2017-03-15 09:35:15 +02:00
Markus Mäkelä
d19e5b376d MXS-1032: Add configurable connector plugin directory
The connector plugin directory can now be controlled with the
`connector_plugindir` argument and configuration option. This should allow
the connector to use the system plugins if the versions are binary
compatible.

Replaced calls to mysql_options to mysql_optionsv as the former is
deprecated in Connector-C 3.0 and the latter is supported in Connector-C
2.3.
2017-03-15 09:11:18 +02:00
Markus Mäkelä
b53ef249f9 Add comment to Jenkins build variables
One of the values is separated by two spaces. Adding a comment will
prevent any accidental fixes to this comparison operation.
2017-03-13 09:14:35 +02:00
Markus Mäkelä
415001a4cd Merge branch '2.1' into develop 2017-03-09 10:02:36 +02:00
Markus Mäkelä
41ff01d16d Merge branch '2.0' into 2.1 2017-03-09 10:01:38 +02:00
Markus Mäkelä
e1a1959bc2 Replace strerror_r with mxs_strerror
The mxs_strerror function requires no local buffer, thus making it simpler
and cleaner to use.
2017-03-09 09:36:57 +02:00
Johan Wikman
76e56a2688 Perform SSL cleanup 2017-03-03 13:28:27 +02:00
Esa Korhonen
7b67cfd1ef Variables written to in signal handlers should be volatile 2017-03-03 09:41:56 +02:00
Markus Mäkelä
3bafcae343 MXS-759: Attempt to create PID directory
When MaxScale is started, it will attempt to create the PID directory. If
the directory does not exist and MaxScale is able to create it, MaxScale
will successfully start whereas it previously failed to do so.

If MaxScale lacks the permissions to create the directory, an error
message is printed to the user explaining the reason why MaxScale fails to
start.
2017-03-02 13:50:31 +02:00
Johan Wikman
49cc2b52e3 Merge branch '2.1.0' into 2.1 2017-02-15 08:44:55 +02:00
Johan Wikman
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
Markus Mäkelä
acd66b4eb3 Fix compiler warnings
Added missing checks for return values of various function calls. Fixed
binlogrouter strerror_r usage and wrong buffer sizes.
2017-02-13 11:44:38 +02:00
Markus Mäkelä
334e71b079 Initialize random number generator in main
The random number generator can be initialized when MaxScale's other
systems are being initialized. This removes the need to initialized it
when the function is used for the first time.
2017-02-10 13:02:39 +02:00
Esa Korhonen
74225daf46 Remove memlog and rdtsc
Neither of these were actively used, so they and any associated tests
were removed.
2017-01-26 13:16:51 +02:00
Esa Korhonen
8d07604436 Split maxscale.h to public and private parts
This header defines some general functions and maxscale main() return
values. Most of it is still public, but there were some functions
which were moved to a core header.
2017-01-26 11:17:25 +02:00
Esa Korhonen
7d51864402 Clean config.h some more
Moved some typedefs to router.h and server.h, changed a few
constants to these enums. Renamed some types in config.h to
remove "Gateway".

There are still some functions in the public header which are
only used in core, but they seem to fit the theme of public functions
so were not moved.
2017-01-25 16:05:51 +02:00
Esa Korhonen
8cffa4ad58 Divide poll.h to core and public headers
Also some cleanup of other headers.
2017-01-20 17:15:27 +02:00
Esa Korhonen
6e38276a20 Rename files, removing "gw"-prefix
Also gwdirs.h.in -> paths.h.in
2017-01-20 12:55:52 +02:00
Esa Korhonen
eff34b91fb Move modules.h to core/maxscale
Also remove some unnecessary includes + cleanup
2017-01-19 15:53:25 +02:00
Esa Korhonen
7ed7f972b1 Divide monitor.h to internal and interface headers similar to filter.h
Definitions and function used by core are in
server/core/maxscale/monitor.h
Definitions and function used by plugins are in
include/maxscale/monitor.h
2017-01-19 09:50:48 +02:00
Markus Mäkelä
0b6b9c3d81 Format core source code and headers
Formatted core source code and headers with Astyle.
2017-01-17 14:47:50 +02:00
Markus Mäkelä
1f07adaf0f Log commit ID for debug builds
Logging the commit ID should help identify which commit was used for which
log file when tests are run.
2017-01-17 10:47:43 +02:00
Markus Mäkelä
d054bc9b04 Split config.h into external and internal parts
The external config.h header defined functions and structures that are
intended to be used by modules. The internal header contains functions
that are used only by the MaxScale core.
2017-01-16 11:02:34 +02:00
Markus Mäkelä
0865eada03 Add module configuration directory
This directory is intended to be the default working directory for
relative pathname resolution. The actual implementation for
MXS_MODULE_PARAM_PATH is done at a later step.
2017-01-11 14:24:26 +02:00
Johan Wikman
2d849e0ab2 Remove MySQL dependency from gateway.cc
The MySQL initialization is now performed by the MySQLClient module.
2017-01-09 09:16:35 +02:00
Johan Wikman
8fc5bdc2f1 Perform query classifier initialization implicitly
The setting up and the initialization of the query classifier has
now been separated. The gateway explicitly sets up the query
classifier (i.e. chooses which one to use and what arguments to
provide), but the actual initialization is performed as part of
the general module initialization.
2017-01-09 09:16:35 +02:00
Johan Wikman
03391748ee Call [process|thread] [init|finish] functions of modules
The process initialization function was also renamed from init to
process_init.
2017-01-05 16:17:50 +02:00
Markus Makela
49aa23468d Align statistics to cache lines
Aligning the statistics object indices to cache line size reduces the CPU
overhead of gathering the statistics. This allows the statistics to more
accurately measure the polling system without the measurement affecting
the outcome.
2016-12-12 10:48:49 +02:00
Markus Makela
5cb738ae03 Fix minor memory leaks
The main function and monitor creation both leaked a few bytes of memory.
2016-12-09 22:28:35 +02:00
Johan Wikman
12f0886ca2 Call destroyInstance after workers have exited
Router and filter instances cannot be destroyed before all worker
threads have exited. Otherwise there is a risk that data gets deleted
while someone might still be accessing it. Further, since all router
and filter instances are created by the main-thread it is better that
they are deleted by that thread as well (and not by whichever thread
happens to execute service_shutdown()). That will reduce the risk that
some unknown assumptions are violated.
2016-12-09 13:00:14 +02:00
Markus Makela
4ae85dc754 Merge branch '2.0' into develop 2016-12-05 21:19:59 +02:00
Markus Makela
6d7e419ed4 Improve --config-check mode
The configuration checking now detects bad router options. This allows for
better coverage of the configuration with only the --config-check flag.
2016-12-05 13:18:20 +02:00
Markus Makela
2efa862944 Remove listmanager code
The code prevented scaling by imposing global spinlocks for the DCBs and
SESSIONs. Removing this list means that a thread-local list must be taken
into use to replace it.
2016-11-30 10:28:23 +02:00
Markus Makela
51842333d7 Temporarily take out the listmanager from use
The listmanager code uses a global spinlock which might cause problems
with multiple threads.
2016-11-30 10:28:22 +02:00
Markus Makela
076b810c1e Create thread specific zombie queues
Because each thread has their own epoll file descriptor and only one
thread can process a DCB, it makes sense to move to a per thread zombie
queue. This removes one of the last restrictions on scalability.
2016-11-30 10:28:22 +02:00
Markus Makela
691989ff04 Split the service header into internal and external parts
The service header in include/maxscale/ contains the public part of the
service API. These functions can be safely used by the modules.

The internal header located in service/core/maxscale/ is used by the core
to initialize MaxScale at startup or to provide other services in a more
controlled way (the config_runtime, for example).
2016-11-28 14:37:26 +02:00
Markus Makela
6ea4e50f2c Clean up service.h
Most of the service header functions now contain the relevant
documentation. Cleaned up small parts of it and renamed functions to be
more consistent.
2016-11-28 14:37:26 +02:00
Johan Wikman
bddcee6f7e Add space between literal and string macro 2016-11-22 10:40:58 +02:00
Johan Wikman
4dbb68cbfe Compile gateway.c as C++
When C and C++ are mixed in a project, main() should be compiled
as C++ to ensure that all C++ static initializations are performed
properly. That may not be strictly true anymore, depending on the
used compiler and environment, but better to do that to be on the
safe side.
2016-11-22 09:12:36 +02:00