4826 Commits

Author SHA1 Message Date
Markus Makela
28bd7c2202 Merge branch '1.2.1-binlog_router_trx' into develop 2016-02-19 18:51:59 +02:00
Markus Makela
fec1ebe925 Removed restrictions on monitor timeouts
The monitor timeouts can now be larger than the monitor interval. This will
allow the combination of low monitoring intervals and large network timeouts.
If a network experiences some periodic lag, it is desirable to allow large
timeout values.
2016-02-19 09:57:15 +02:00
Markus Makela
a947b33769 MXS-585: Fixed buffer length instead of packet length being used in a calculation
The usage of the buffer length in the authentication success checks causes
the authentication to fail with routers that don't require statement input.
2016-02-18 18:03:21 +02:00
Markus Makela
c25ef2f72a Added missing 5.5.5- prefix to MaxScale MySQL version
The handshake was sending "MaxScale 1.3.0" as the server version which causes
some connectors to think that the version is not valid.
2016-02-18 18:03:21 +02:00
Johan Wikman
52ae676fa4 Add cast when converting to size_t from double. 2016-02-18 13:19:08 +02:00
Johan Wikman
5cfe352a8a Remove inline from function definition. 2016-02-18 11:44:59 +02:00
Markus Makela
4c3f7e320e Added configurable connector repo and tags
This allows different versions and repositories to be used when building
the MariaDB connector.
2016-02-17 20:42:11 +02:00
Markus Makela
effa2dbdae Set dbfwfilter maturity to GA and set the version to 1.1.0
The module has been GA for a while and it has also changed so the version
should be updated.
2016-02-17 10:59:26 +02:00
Markus Makela
497a72d42f Added extra logging to dbfwfilter output
The real username and host is now logged in addition to the user definition
that it matched. The messages also have the service name to distinct
connections to two different services which both use the same filter.
2016-02-17 10:45:21 +02:00
Markus Makela
59f5880898 Added missing OK byte to payload size calculation
The OK byte was not taken into notice when the total size of all the payloads
in all the packets was calculated.
2016-02-17 08:30:50 +02:00
Markus Makela
47281d1c55 MXS-582: Moved to crypt_r
Replaced all calls to crypt with crypt_r.
2016-02-16 16:04:50 +02:00
Markus Makela
63ce9fe6bc Fixed formatting and added more error checks
Added log messages when ftruncate fails and cleaned up formatting.
2016-02-16 13:06:25 +02:00
Markus Makela
cd2af6ffef Cleaned up the code based on the code review
Added missing error condition checks and cleaned up code.
2016-02-16 13:06:25 +02:00
Markus Makela
a55f017c75 Fixed packets with a length of one being ignored
The packets were not written into the binlogs which caused binlog corruption.
2016-02-16 13:06:25 +02:00
Markus Makela
9306b9d68c Added detection of checksums split across two packets
The checksums should now be processed properly event if the event is in more than
one packet.
2016-02-16 13:06:25 +02:00
Markus Makela
36896afcbd Fixed missing NULL check when reading records
If the binlog record was not found, a NULL pointer is returned. There was no
check for the return value and it assumed that it was always non-NULL.
2016-02-16 13:06:25 +02:00
Markus Makela
74c8b5e296 Fixed events larger than 2^24 failing without transaction safety
If transaction safety was disabled and a large event sent in multiple SQL
packets was received, the distribution of that event to the slaves would fail.
2016-02-16 13:06:25 +02:00
Markus Makela
2b7e2d3043 Added checksum calculations for events larger than 2^24 bytes
The checksums are now properly calculated for large events that span multiple
SQL packets.
2016-02-16 13:06:25 +02:00
Markus Makela
3609f97ba0 Fixed events which are exactly 0x00fffffe bytes long failing to replicate
The empty packet sent after a large event which fits into exactly one packet
was written to disk and the writing of no bytes caused it to be treated as
an error.
2016-02-16 13:06:25 +02:00
MassimilianoPinto
476691eda1 Removed log message for event larger than 16MB
The log message used during tests is now removed
2016-02-16 13:06:25 +02:00
Markus Makela
3e04a36ac3 Added support for distribution of packets larger than 2^24 bytes
Moved the the sending of the replication events to a different function
and added support for events that span multiple MySQL packets.
2016-02-16 13:06:25 +02:00
Markus Makela
12ee568978 Fixed last_written being set to the size of the event
The addition used =+ instead of += which caused it to be an assignment.
2016-02-16 13:06:25 +02:00
Markus Makela
d2b4713d27 Added missing condition to else clause
This fixes all packets being considered as large packets.
2016-02-16 13:06:25 +02:00
Markus Makela
ae33df3cbc Large events are now processed in chuncks
The router->last_written is used to store the position where the last event was
written. The replication header is also stored in a separate structure in
the router which is used later when the last packet of a multi-packet event
arrives.
2016-02-16 13:06:24 +02:00
MassimilianoPinto
d3e1d4dd2f First fix for 16MB handling in the master part
First fix for 16MB handling in the master part.

Distribute events to up to date slave is not included yet
2016-02-16 13:06:24 +02:00
MassimilianoPinto
ab1fb90d86 Fix for 16MB transmission in the slave part
Fix for 16MB transmission in the slave part
2016-02-16 13:06:24 +02:00
Markus Makela
6da0446df0 Made function parameters constant and added debug checks
The number of written characters is now checked and should be lower than
compared bytes. The parameters to the dbusers.c query functions are now const
where possible.
2016-02-16 11:16:41 +02:00
Markus Makela
c4bcc4ce88 Table-level access to databases is now detected
Previously the users needed at least SELECT permission on the database level to
be able to connect with a default database through MaxScale. With this change,
the query that retrieves the database users has been changed to also include
table-level grants for users. This will allow users with grants to only some of
the tables in a database to be able to connect through MaxScale with a default
database.
2016-02-16 11:16:41 +02:00
Markus Makela
e468132b8b Cleaned up user data queries
The queries are now created at runtime to allow for a more varied syntax. This
removes the need to have separate query strings for the standard mysql.user
table and for the MySQL 5.7 version of it. In addition to this, the exclusion
of the root user is now done at the same time which removes the need to manually
form the query string.
2016-02-16 11:16:41 +02:00
Markus Makela
a628fdcb17 Added configurable executable file directory
This allows MaxScale to launch processes from the directory where
the `maxscale` executable is located.
2016-02-15 11:12:54 +02:00
Markus Makela
477197ff5b MXS-581: Moved to MD5 based encryption of passwords
The admin users are now encrypted with a more complex algorithm which reduces
the chance of two passwords generating the same hash by a significant amount.

Refer to the GNU libc manual for more details about the crypt function:
http://www.gnu.org/software/libc/manual/html_node/crypt.html
2016-02-12 23:31:43 +02:00
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
MassimilianoPinto
4eccc1acb6 When creating heartbeat packet too many bytes were copied.
The memory area ‘ptr’ points to contains now the right data
2016-02-11 17:06:13 +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