Commit Graph

5778 Commits

Author SHA1 Message Date
00f16e1fa5 Make parameters for command_is_mandatory const
The parameters can be const as they aren't modified.
2017-01-31 10:16:33 +02:00
82105d20e1 Fix a typo in readwritesplit documentation
Fixed a typo in readwritesplit documentation. The cluster should be in
plural form.
2017-01-31 10:10:25 +02:00
6cd16d26b8 Flush the producer after every new record
As the cdc_kafka_producer script is an example, it should flush the
producer after every new record. This should make it easier to see that
events from MaxScale are sent to Kafka.
2017-01-30 20:14:27 +02:00
4bbd513b1e Update release notes
Added dbfwfilter changes and fixed bugs to release notes.
2017-01-30 19:26:18 +02:00
443af1aee3 Use preliminary 2.3.3 release of Connector/C
The new version has fixed a bug which MaxScale depends on.
2017-01-30 19:20:46 +02:00
fdee329198 MXS-1111: Allow COM_PING and other commands to pass the firewall
The firewall filter should allow COM_PING and other similar commands to
pass through as they are mainly used to check the status of the backend
server or to display statistics. The COM_PROCESS_KILL is the exception as
it affects the state of the backend server. This is better controlled with
permissions in the server than in the firewall filter.

Commands that require special grants aren't allowed to pass as they are
mainly for maintenance purposes and these should not be done through the
firewall.
2017-01-30 19:16:33 +02:00
122027e4a3 Fix binlogrouter test
The test used the wrong working directory. blr_slave.c didn't check the
input for NULL values.
2017-01-30 16:46:24 +02:00
22698fdf21 MXS-951: Backport fix to 2.0
Backported the fix for 2.0.4.
2017-01-27 16:17:39 +02:00
78545b2c5c Read complete lines with Kafka producer
There's no need to process the JSON twice as the Kafka producer is
expected to be used with the Python CDC client which already splits the
JSON with newlines.
2017-01-27 13:06:25 +02:00
81b9d51aab Fix crash on startup
The Avro file was initialized in the wrong order and uninitialized values
were used.
2017-01-27 12:55:07 +02:00
8da655b7cb Improve maxavro failure handling and error messages
When the creation of the Avro schema would fail for a file that is being
opened, the errors wouldn't be handled properly. Also free all allocated
memory on failure.

All errors that set errno are now properly logged with the error number
and message.
2017-01-26 16:16:41 +02:00
84040be182 Add missing error handling to Avro file handling
Some of the JSON errors weren't handled which could cause problems when a
malformed schema definition is read.

Also added more error messages for situations when opening of the files
fails.
2017-01-26 10:23:26 +02:00
c2b03100f0 Update changelog and release notes of 2.0.4 2017-01-25 15:30:57 +02:00
98c2d37156 MXS-1080: Document max_slave_replication_lag behavior
The max_slave_replication_lag parameter for readwritesplit only works for
monitors that detect replication lag. As the MySQL monitor is the only one
that implements this functionality, the parameter only has meaning when
used with master-slave clusters.
2017-01-19 13:10:46 +02:00
fed61fde98 Disable prepared statement execution in dbfwfilter
The dbfwfilter doesn't parse prepared statements for all rules which
requires that they are disabled.
2017-01-19 08:57:15 +02:00
3793f685ac Store DATETIME correctly in avrorouter
DATETIME was stored as a raw year value when it should've been stored as
the raw year value minus 1900.
2017-01-19 08:57:15 +02:00
8fc74e7b37 Update version for 2.0.4 2017-01-18 12:42:46 +02:00
68965639d2 Document zero weightby values
The behavior when a server had a zero value for the weighting parameter
was not documented.
2016-12-20 02:32:48 +02:00
7a08ea99af Change README to Markdown and fix Travis for 2.0
Converting the README into Markdown format makes it a lot easier to
comprehent. Also cleaned up the formatting.

The 2.0 branch had a broken Travis configuration. Fixed it and changed
links to point to 2.0 branch.
2016-12-19 10:55:28 +02:00
9e27e6c002 Don't ask for unlimited files
There's a bug reported on Launchpad
(https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1420640) that
describes a similar situation. The solution is to request a lower limit of
open files for the process.
2016-12-16 15:51:17 +02:00
15040e7a76 Update version number 2016-12-14 12:38:27 +02:00
fe2a607d53 Add 2.0.3 release notes 2016-12-14 10:46:21 +02:00
251e9a6c0f fixed wrong path 2016-12-13 17:01:46 +02:00
5c5b2594b5 MXS-1044: Added init-script for SLES11 2016-12-13 17:01:46 +02:00
3872cebd09 MXS-1048: Handle backquoted database names
The schemarouter didn't expect backquoted database names for SHOW TABLE
and USE statements.
2016-12-13 13:51:46 +02:00
ea81990542 Update Change Log 2016-12-12 13:54:23 +02:00
15a8675fca Mark error handler as called for closed sessions
When a DCB error occurs, the handleError entry point of the routers is
called. The caller of this entry point expects that the error handler
marks the DCB as handled. The aforementioned behavior is wrong as the
error handler should not keep track of whether the handler was already
called.
2016-12-11 21:41:38 +02:00
d4d40c0b9b MXS-1047: Backport to 2.0
Backported commits 0e50ecb525003b87e8199708008e4a18606c5e54 and
570e12942ba3d2363ec7098dcf1d35c6b68667a1 to 2.0.
2016-12-09 11:13:27 +02:00
0fab454e66 Close the DCB and the related backend at the same time
Closing the DCB and the backend reference that uses it at the same time
makes the error handling code clearer and removes some of the assumptions
that the code made. It will cause the DCB to be closed in multiple places
but the logic of why a DCB is being closed is more visible from the code.

This change should remove all cases where a DCB is closed without a
tightly coupled backend reference.
2016-12-07 10:48:54 +02:00
970d70700d Close master references when they lose the master state
If the `error_on_write` mode is used when a master loses the master state,
the backend would not get closed. This would allow masters that appear
back to be used which is not intended.
2016-12-07 08:51:51 +02:00
1a9232b152 Fix dbfwfilter rule syntax documentation
The documentation listed the rules as a comma separated list when they
were parsed as a whitespace separated list. The match specifiers were also
defined as optional when in fact they were mandatory.
2016-12-05 17:26:21 +02:00
21098e0a26 MXS-1045: Delete default SIGCHLD handler
If the default signal handler is not deleted for the original parent
process, the forked daemon process never receives the signals.
2016-12-05 15:03:21 +02:00
943aa48fb5 Make sure DCBs are OK before closing them
Added a check for the validity of the backend DCBs before they are
closed. This should guarantee that only valid DCBs are closed by
readwritesplit.

However, this is not the correct solution for the problem. The DCB should
not be in an invalid state in the first place and this fix just removes
the bad side effects of the double closing.

With the added logging in the readwritesplit error handler, more detailed
information should become available.
2016-12-04 06:35:35 +02:00
1d9d325a01 MXS-1026: Prevent crash with NullAuth
The authenticator module will not crash but backend authentication will
always fail.
2016-12-02 14:26:43 +02:00
6f7b572822 Only close DCBs we know are valid
If a DCB is passed to the error handler for which we cannot find the
corresponding backend reference, it should not be closed.

Added extra logging for situations where the backend reference can't be
found or it is in the wrong state.
2016-12-02 14:26:43 +02:00
0218ac9e9c MXS-1043: Handle @@identity like @@last_insert_id
The type of @@identity, @@last_insert_id and last_insert_id() is
now the same, that is, QUERY_TYPE_READ|QUERY_TYPE_MASTER_READ.
2016-12-02 11:35:50 +02:00
ac0f975f9c MXS-1033: Fix crash on 'maxadmin list clients'
When the client connections were listed, the DCB state was not
inspected. Only DCBs in the polling state should be printed as they are
guaranteed to be in a valid state.
2016-11-30 23:10:24 +02:00
82ef1a9149 Document the addition of the Upstart config file
The config file for Upstart is added in 2.0.3 which is now documented in
the installation guide and the release notes.
2016-11-30 15:05:23 +02:00
61cd9078d6 Add note about strip_db_esc to configuration guide
The default value was changed in version 2.0.1.
2016-11-30 15:05:23 +02:00
f831295847 In case of error ftruncate is called with router->binlog_position
In case of error router->binlog_position is used with truncate and
error message instead of router->last_written
2016-11-30 10:05:00 +01:00
38e4a5902f MXS-576 Check for negative values for config settings
Previously, negative values were allowed for persistpoolmax and
persistmaxtime. Now they cause an error. Also, monitor_interval
allowed negative (or zero) values, which were then implicitly cast to
unsigned, causing unintended behaviour. Now this causes a warning
and the default value is used.
2016-11-29 14:53:27 +02:00
9ede657a9b Change error message when permissions on .secrets are wrong
If the user running MaxScale could open the .secrets-file and the
file permissions were anything other than owner:read, the
secrets_readkeys() would fail with error message
"Ignoring secrets file <path>, invalid permissions." Now the
message is more accurate in stating the expected permissions.
2016-11-29 14:52:30 +02:00
cc54d80a8b Fix memory leaks in maxinfo (modified for 2.0 and develop-branch)
MXS-1009. This commit adds a gwbuf_free after maxinfo_execute() to
free a buffer with an sql-query after it has been processed. Also,
the parse tree in maxinfo_execute_query() is now freed. The tree_free-
function was renamed to maxinfo_tree_free, since it is now globally
available.

This commit has additional changes (in relation to the 1.4.4 branch)
to remove errors caused by differences in the html and sql-sides of
MaxInfo.
2016-11-29 14:11:12 +02:00
0bc68742a6 Do error handling in one big locked action
This is not the optimal way to do error handling but it should solve all
problems that could rise from the multi-threaded model of MaxScale.

By taking a lock at the start of handleError, we'll be able to modify the
dcb error handling flag in a thread-safe manner. This should prevent
double error handling for all DCBs.
2016-11-29 12:07:12 +02:00
f8f400bdfd Only close the errored DCB if it is not in use
It was theoretically possible that a DCB was closed while it was still in
use.
2016-11-29 12:07:12 +02:00
8dae8136aa Add more logging to solve MXS-956
If a DCB is about to be closed but is has already been closed, a message
is logged. This will allow us to figure out exactly where the DCB is
closed.
2016-11-29 12:07:12 +02:00
9362954e82 Add newlines to avrorouter JSON output
JSON does not have a concept of streams and a common way to stream JSON is
to separate each JSON object with a newline. Adding a newline makes it
easier to parse as JSON values do not natively contain newlines.
2016-11-29 00:53:38 +02:00
2fe13719bc MXS-1027: Add Upstart config file
Various older systems use Upstart to control services. MaxScale should
provide both init.d scripts and Upstart configurations for systems that
don't support systemd.
2016-11-28 10:48:54 +02:00
cb93db4647 Make a copy of the client request
If the request isn't copied, the buffer will be freed twice.
2016-11-25 23:19:29 +02:00
1432677406 Fix regression in prepared statement routing
The prepared statements were router according to the real type instead of
being router to the master. This was caused by the change in the route
target function.
2016-11-21 23:05:46 +02:00