4774 Commits

Author SHA1 Message Date
Markus Makela
2e408a17d5 Added missing schemarouter parameter documentation
The `ignore_databases` and `ignore_databases_regex` were missing from
the schemarouter documentation.
2016-02-12 21:19:38 +02:00
Markus Makela
26cbcb7365 MXS-511: Made log messages about master status coherent
The checking of the master status and the possible error logging were done
in two different steps. This led to confusing error messages when the state
of the server changed between the check and the logging of the error message.
2016-02-12 21:18:57 +02:00
Markus Makela
17234cec98 MXS-577: Either systemd files or init srcipts are installed
Systems that support systemd only use the systemd service files. For other
systems, System V style init scripts are installed. It is not recommended to
install both of them since it's possible that they will perform differently.
2016-02-12 21:18:56 +02:00
Johan Wikman
0aaba6bc5f Use getauxval for obtaining the executable path.
It appears that reading /proc/self/exe actually can return the path
of the shared library from which the reading is made.
2016-02-12 16:32:02 +02:00
Johan Wikman
d1ba050bfd Make housekeeper const correct. 2016-02-12 16:16:32 +02:00
Johan Wikman
1e363b9ad7 Figure out path of plugin process executable.
The plugin process executable is assumed to be installed in the
same directory as the maxscale executable.
2016-02-12 10:41:11 +02:00
Johan Wikman
62aa1ea5d7 Remove module to be freed from list.
When a module is unregistered, it must be removed from the list.
Otherwise, if explicit unregistering of a module is made, there
will be a crash at shutdown when all modules are unregistered.
2016-02-12 10:15:06 +02:00
MassimilianoPinto
e777828bd0 When creating heartbeat packet too many bytes were copied.
The memory area ‘ptr’ points to contains now the right data
2016-02-11 17:12:10 +01:00
Johan Wikman
cbd73e285a Cleanup signal disabling and enabling.
The act of disabling and enabling signals are now in separate
functions.
2016-02-11 11:51:05 +02:00
Markus Makela
d5d1089d89 MXS-574: Fixed systemd script
The TimeoutStartSec is now properly capitalized.
2016-02-11 11:04:38 +02:00
Markus Makela
b32dfed97d MXS-575: Fixed Nagios script permissions
The scripts are now properly installed as programs instead of files.
2016-02-11 11:04:38 +02:00
Markus Makela
aaed539444 MXS-537: Fixed systemd service file permissions
The file is now installed as a configuration file instead of a custom file with
explicit permissions.
2016-02-11 11:04:38 +02:00
Johan Wikman
000579814e Make functions const correct.
- get_expanded_pathname
- print_log_n_stderr
- resoved_maxscale_conf_fname
2016-02-11 10:44:32 +02:00
Markus Makela
eac672421d Merge branch 'develop' of github.com:mariadb-corporation/MaxScale into develop 2016-02-11 10:23:33 +02:00
Markus Makela
cfefc046e9 Merge branch 'release-1.3.0' into develop 2016-02-11 10:23:00 +02:00
Johan Wikman
2e5bfc14f2 Introduce skeleton plugin process.
For external parsing there will be a separate process that handles
parse requests sent from MaxScale. From MaxScale's perspective there
will just be a specific query classifier plugin that upon startup
launches that external process and manages its lifetime. That is,
MaxScale proper will be completely oblivious of this arrangement.

The skeleton process introduced here does nothing; just sits in
a loop sleeping. The skeleton query classifier plugin currently
loads the MySQL embedded query classifier and performs parsing
using it. That way the external process based query classifier can
immediately be used.

Next step is to introduce process management into the picture without
actually moving the parsing anywhere.
2016-02-11 09:05:37 +02:00
Johan Wikman
8a814fbec4 Make log_manager self-contained.
log_manager.h now includes all necessary header files.
2016-02-10 15:32:48 +02:00
Johan Wikman
e1273a2e5f Clean skygw_utils.
Not finished yet. There are e.g. a number of functions that are only used
by the log manager. They could just as well be moved as private functions
to log_manager.cc.
2016-02-09 17:43:55 +02:00
Johan Wikman
38db155fef Make mlist a separate component.
Mlist is now made available as a separate component instead of
being a part of skygw_utils.
2016-02-09 17:31:15 +02:00
Markus Makela
eaddc4ea9d Fixed dbfwfilter build failure on Ubuntu
The bison executable didn't generate the headers even though it was instructed
to generate them. This was caused by an older CMake version.
2016-02-09 16:35:51 +02:00
Johan Wikman
2692d1081c Add slist.
Slist removed from skygw_utils and added as a separate component.
Nobody seems to be using it, so it could also simply be removed.
Left in place for the time being.
2016-02-09 15:30:27 +02:00
Johan Wikman
d3c288abf9 Remove warning when built in release mode. 2016-02-09 15:26:41 +02:00
Johan Wikman
adbc2074de Remove log_manager as a separate component.
Log_manager files are now in server/core and the log manager test
files in server/core/test. The directory log_manager is removed.
2016-02-09 11:17:31 +02:00
Markus Makela
4f2a87f732 MXS-22: Shutting down monitor now closes database connections
Shutting down monitors is not supposed to be done ofter so there is no true
benefit from keeping the connections open. With the refactoring of the monitor
interface, this can be done in a centralized place.
2016-02-09 11:12:38 +02:00
Markus Makela
9e33f300b0 Added flex/bison based parsing of rules to dbfwfilter
The dbfwfilter now uses flex to tokenize the rules and bison to process those
tokens into a language. This will make the syntax checks more robust and
the rule language easier to maintain. It also makes the processing of rules
easier to understand and removes most of the C language side checks for
correctness.

The old rule processing functions are still left intact and will be removed
at a later point.
2016-02-09 11:00:27 +02:00
Markus Makela
6055ba25bf Added logging of matching and non-matching queries to dbfwfilter
When configured to log matching queries, the dbfwfilter will log all queries
that match a rule. The rule name, user name and the query itself are logged.

It is also possible to match all queries that do not match a rule. Only the user
name and query is logged in this mode.
2016-02-09 11:00:27 +02:00
Markus Makela
5efd5d8927 Added user configurable actions to dbfwfilter
The dbfwfilter can now either allow, block or ignore queries that match the
configured rules.
2016-02-09 11:00:27 +02:00
Markus Makela
9acdd4e70c Fixed tests failing to build
The tests were not linking against the maxscale-common library.
2016-02-09 10:59:11 +02:00
Markus Makela
c506559452 MXS-400: Servers that are both master and slave now work with readwritesplit
The check for the server status explicitly denied servers that are both master
and slave from being chosed as candidates for queries. This is only a problem
when a user manually sets the server states to both master and slave.

The monitors resolve the replication topology based on the servers that
the monitors see and this always results in at least one slave server.
2016-02-08 19:44:33 +02:00
Johan Wikman
4a4f22c9a7 Make query_classifier part of core.
The query classifier interface is now built as an integral
part of MaxScale core.
2016-02-08 11:44:07 +02:00
Johan Wikman
834d04ed6c Merge branch 'MXS-517' into develop 2016-02-08 11:03:31 +02:00
Johan Wikman
0cc3db9634 Fix forgotten merge conflict. 2016-02-08 10:55:08 +02:00
Johan Wikman
7ff3a95b28 Reformat maxconfig.h 2016-02-08 10:41:34 +02:00
Johan Wikman
c579ed7fce Merge remote-tracking branch 'origin/MXS-517' into MXS-517 2016-02-08 10:33:56 +02:00
Markus Makela
379cb6c781 MXS-564: Slave server states were not properly cleared after session commands
When a command that changes the session state is executed on all servers and
a slave server goes down, an error message was sent to the client even though
one wasn't expected. These appeared as odd connection errors on the client side.
2016-02-05 13:54:24 +02:00
Markus Makela
9432967da5 Don't assert the master server state when routing query to slave
When a query is being routed to the slave, it is not necessary to assert that
the master server's state is still master. It is possible that the master server
changes states while the query is being routed but that doesn't affect the query
being currently routed.
2016-02-04 09:57:27 +02:00
Markus Makela
e731f6a29e Fixed double freeing of buffers
The buffers in readwritesplit are handled at the routeQuery level and freeing
them at lower levels cause a double free of the used buffers.
2016-02-04 09:57:27 +02:00
Markus Makela
d9eeb72198 Added missing check for closed master backend reference into readwritesplit
The master DCB was checked for NULL-ness but the proper way is to check if
the backend reference is closed. This will fix a debug assertion in addition
to possibly preventing crashes.
2016-02-04 09:57:27 +02:00
Markus Makela
2f65c3a7b8 MariaDB Connector C is build from source if it is not found on the system
The FindMariaDBConnector.cmake file now checks if the found library actually is
the MariaDB Connector-C library. If the found library is not the MariaDB
Connector-C, it will be built from source.
2016-02-03 11:35:01 +02:00
Markus Makela
e7fb2640d3 Fixed authentication failing due to unknown database even though it exists
When the shard maps are being updated they are set into a stale state. This
means that one client connection is updating the shard maps and the information
in the shard map is not the most recent. This does mean that the information
is valid and authentication should succeed even if the shard map is stale.
2016-02-03 00:47:06 +02:00
Markus Makela
081bacdc64 Switched to MySQL client library headers for MaxScale
The include directories previously used by MaxScale were from the embedded
library. All parts of MaxScale apart from the query classifier now use
the client libraries.
2016-02-02 14:04:59 +02:00
Markus Makela
0d51f78a2a Dbfwfilter now uses PCRE2 regular expressions
Switched from the POSIX regex implementation to PCRE2. This should improve the
filter's performance as well as make the code more manageable.
2016-02-02 12:38:44 +02:00
Markus Makela
7bac2f8fab Moved the applying of rules to users to its own function
This makes the function easier to understand as a whole.
2016-02-02 12:38:44 +02:00
Johan Wikman
2bbe1b068a Allow the query classifier to be specified in maxscale.cnf 2016-02-01 20:44:36 +02:00
Johan Wikman
e668abec5b Load config before qc is initialized.
That way a query_classifier entry in maxscale.cnf will be available
before the initialization takes place.
2016-02-01 20:38:51 +02:00
Johan Wikman
bbfcbc18c6 Make it possible to specify query classifier name.
If none provided or if the name is empty, the default query
classifier is loaded.
2016-02-01 19:46:16 +02:00
Johan Wikman
72f02164fc Reformat maxconfig.h 2016-02-01 19:22:07 +02:00
Johan Wikman
018e2426f9 Remove MySQL embedded initilization from gateway.c.
Since maxscale-common is linked to the connector-c library
and no longer to the MySql embedded library, mysql_library_init
does not need any parameters.
2016-02-01 18:28:09 +02:00
Johan Wikman
21b415eec0 Remove MySQL arguments from qc_init.
There can be any sort of library behind qc_init. Hence the arguments
cannot be hardwired to be like the embedded library wants them.

Eventually it might make sense to allow passing arguments from
maxscale.cnf.
2016-02-01 15:53:34 +02:00
Johan Wikman
fc6f49fe8a Link against Connector-C.
Now, qc_mysqlembedded is linked against MySQL's embedded library,
and MaxScale itself against Connector-C.

So, in order to build MaxScale, Connector-C must be installed.
This has been tested with Connector-C 2.2.1.

The build variable MYSQLCLIENT_LIBRARIES is no longer used.
2016-02-01 15:43:05 +02:00