62 Commits

Author SHA1 Message Date
MassimilianoPinto
cb57e10761 Develop merge
Develop merge
2017-06-29 15:34:22 +02:00
Esa Korhonen
77a692e0c3 Set minimun VLA size to 1 2017-06-16 10:17:27 +03:00
Esa Korhonen
3260069ed8 Fix compile error on Centos7 2017-06-15 15:17:33 +03:00
Esa Korhonen
81eeed55aa Add generic debug flag to MaxScale
MXS-1282. The flags "-g=arglist" or "--debug=arglist" activate
the debug settings specified in the comma-separated list arglist.
Currently, the setting "disable-module-unloading", which prevents
modules (.so-files) from being unloaded at exit, is supported. This
allows Valgrind to produce line numbers for leak reports when the
memory was allocated in a module. The setting "enable-module-unloading"
is also available, but this is activated by default.

The debug arguments and their actions are defined in a structure
array, so adding more is straightforward.
2017-06-15 11:23:34 +03:00
Johan Wikman
f546a17e77 Update change date of 2.2 2017-06-01 10:24:20 +03:00
Markus Mäkelä
ead9059eeb MXS-1220: Add /users/ resource
The /users/ resource shows all user accounts that can be used with
MaxScale. This resource is further split into two resource collections,
/users/inet and /users/unix, which contain the network users and Linux
accounts respectively.
2017-05-24 15:05:10 +03:00
Markus Mäkelä
ca7b24f6fa MXS-1220: Allow admin interface to be disabled
Allowing the admin interface to be disabled completely makes it possible
to remove any security concerns that could arise from its use.
2017-05-14 10:06:02 +03:00
Markus Mäkelä
4ed4773d91 MXS-1220: Allow binding to a specific address
The admin interface can now bind to a specific network interface.
2017-05-04 09:17:50 +03:00
Markus Mäkelä
23b6fb3e6d MXS-1220: Create separate admin thread
When MaxScale is started, a separate thread for the administrative
interface is started. This allows the worker threads to handle client
requests while the administrative thread handles the lower priority
administrative requests.

The administrative interface responds to all request with a 200 OK HTTP
response. This allows the administrative interface itself to be tested.
2017-05-04 09:10:31 +03:00
Johan Wikman
ab31cd4b1a Use O_DIRECT, but only if available.
TODO: The kernel version should be looked up at startup and made
      generally available so that it is readily available for
      anybody interested.
2017-05-03 13:39:26 +03:00
Johan Wikman
a27bec5e88 Add return value to Worker::init()
Cleaner to return status than exit upon failure.
2017-04-21 19:57:45 +03:00
Johan Wikman
f1e99a475a Remove unneded worker C-API 2017-04-20 13:51:16 +03:00
Johan Wikman
b89cf62d38 Sorting out merge from 2.1 2017-04-20 13:51:16 +03:00
Johan Wikman
5138032fe5 Add shutdown support
The shutdown is now performed so that a shutdown message is
sent to all workers. When the workers receive that message, they
turn on a shutdown flag, which subsequently is checked in the poll
loop.
2017-04-20 13:51:16 +03:00
Johan Wikman
016ed89b3e Move worker thread management to worker
The worker threads are now started by the workers themselves.
2017-04-20 13:51:16 +03:00
Johan Wikman
72977128f7 Introduce private worker header 2017-04-20 13:51:16 +03:00
Johan Wikman
bb6e0767cc Add first version of MXS_WORKER
MXS_WORKER is an abstraction of a worker aka worker thread.
It has a pipe whose read descriptor is added to the worker/thread
specific poll set and a write descriptor used for sending messages
to the worker.

The worker exposes a function mxs_worker_post_message using which
messages can be sent to the worker. These messages can be sent from
any thread but will be delivered on the thread dedicated for the
worker.

To illustrate how it works, maxadmin has been provided with a new
command "ping workers" that sends a message to every worker, which
then logs a message to the log.

Additional refactoring are needed, since there currently are overlaps
and undesirable interactions between the poll mechanism, the thread
mechanism and the worker mechanism.

This is visible currently, for instance, by it not being possible to
shut down MaxScale. The reason is that the workers should be shut down
first, then the poll mechanism and finally the threads. The shutdown
need to be arranged so that a shutdown message is sent to the workers
who then cause the polling loop to exit, which will cause the threads
to exit.

That can be arranged cleanly by making poll_waitevents() a "method"
of the worker, which implies that the poll set becomes a "member
variable" of the worker.

To be continued.
2017-04-20 13:51:16 +03:00
Johan Wikman
85faca74f7 Move DCB specific event handling to dcb.c 2017-04-20 13:51:16 +03:00
Johan Wikman
c3cfc86a7b Merge branch '2.1' into develop 2017-04-19 18:19:13 +03:00
Markus Mäkelä
a54d6fe816 Add connector plugindir to help output
The output now displays the connector directory.
2017-04-13 17:57:52 +03:00
Markus Mäkelä
7bd05d4581 Merge branch '2.1' into develop 2017-03-22 15:20:21 +02:00
Johan Wikman
4ca3c19ee3 Use [true|false] instead of [TRUE|FALSE] 2017-03-21 15:17:44 +02:00
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