5765 Commits

Author SHA1 Message Date
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Johan Wikman
8fc74e7b37 Update version for 2.0.4 2017-01-18 12:42:46 +02:00
Markus Mäkelä
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
Markus Makela
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
Markus Mäkelä
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
Johan Wikman
15040e7a76 Update version number 2016-12-14 12:38:27 +02:00
Johan Wikman
fe2a607d53 Add 2.0.3 release notes 2016-12-14 10:46:21 +02:00
Bernd Wolber
251e9a6c0f fixed wrong path 2016-12-13 17:01:46 +02:00
Bernd Wolber
5c5b2594b5 MXS-1044: Added init-script for SLES11 2016-12-13 17:01:46 +02:00
Markus Makela
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
Johan Wikman
ea81990542 Update Change Log 2016-12-12 13:54:23 +02:00
Markus Makela
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
Markus Makela
d4d40c0b9b MXS-1047: Backport to 2.0
Backported commits 0e50ecb525003b87e8199708008e4a18606c5e54 and
570e12942ba3d2363ec7098dcf1d35c6b68667a1 to 2.0.
2016-12-09 11:13:27 +02:00
Markus Makela
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
Markus Makela
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
Markus Makela
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
Markus Makela
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
Markus Makela
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
Markus Makela
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
Markus Makela
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
Johan Wikman
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
Markus Makela
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
Markus Makela
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
Markus Makela
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
MassimilianoPinto
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
ekorh475
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
ekorh475
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
ekorh475
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
Markus Makela
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
Markus Makela
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
Markus Makela
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
Markus Makela
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
Markus Makela
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
Markus Makela
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
Markus Makela
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
Johan Wikman
afa175c3ab Update 2.0.2 Release Notes (part 2) 2016-11-21 13:03:47 +02:00
ekorh475
1a1c95fd3b Fix memory leak in script execution (MXS-1008) 2016-11-21 12:54:18 +02:00
Johan Wikman
3b30d5c810 Update 2.0.2 release notes 2016-11-21 10:20:22 +02:00
Johan Wikman
ef4fe8785f Update ChangeLog 2016-11-21 10:20:22 +02:00
Johan Wikman
6a68338c72 Update version to 2.0.2 2016-11-21 10:20:22 +02:00
ekorh475
de4ea067cf Fix for MXS-968
This commit adds a free() to null_auth_free_client_data, which plugs
the memory leak in maxinfo.

Also, this commit fixes some segfaults when multiple threads are
running status_row() or variable_row(). The functions use
statically allocated index variables, which often go out-of-bounds
in concurrent use. This fix changes the indexes to thread-specific
variables, with allocating and deallocating. This does seem to slow
the functions down somewhat.
2016-11-18 18:57:57 +02:00
ekorh475
5198c3e456 Run astyle on httpd.c and maxinfo_exec.c 2016-11-18 18:49:21 +02:00
Johan Wikman
ecb6680e71 MXS-976: qc_sqlite: Force initialization of sqlite3
Sqlite3 performs some lazy initialization, during which it internally
parses some SQL statements of its own. Earlier there was detection code
for noticing that, but it was costly and errorprone.

Now, sqlite3 is forced to perform the initialization at startup so that
we no longer need any detection code.
2016-11-18 16:04:26 +02:00
Johan Wikman
d640291023 Add crashing test-case
With 2.0.1 or earlier, if a statement contains a trailing NULL,
the statement will inside qc_sqlite.c incorrectly be assumed not
to be the one to be classified with a crash being indirectly the
result.
2016-11-18 16:00:57 +02:00
Markus Makela
4e007e87d0 Allow stale master status to be assigned via maxadmin
If a master once had slaves and is in the stale status, it will not retain
this status after a restart. Without storing on-disk information, the
stale master status cannot be deduced by looking at the master
alone. Because of this, the user should be able to manually enable the
stale master status.
2016-11-17 12:30:05 +02:00
Markus Makela
5aefd35df9 MXS-969: Detect user variable modifications
With the use_sql_variables_in=master option, readwritesplit should route
all user variable modifications and reads with user variables to the
master.

Previously, the modification of user variables was grouped into generic
system variables which caused all modifications to system variables to go
to the master only. The router requires a finer grained distiction between
normal system variable modifications and user variable modifications.

With the improvements to the query classifier, readwritesplit now properly
routes all user variable operations to the master and other system
variable modifications to all servers.
2016-11-16 15:26:06 +02:00
Johan Wikman
59ee5a78c9 MXS-969: Report user var modifications properly
User variable modifications are now reported as QUERY_TYPE_USERVAR_WRITE
and not as QUERY_TYPE_GSYSVAR_WRITE as earlier.
2016-11-16 15:26:06 +02:00
Markus Makela
b594bdc42a MXS-975: Remove hard limit on listen backlog
The listen() backlog is now set to INT_MAX which should guarantee that the
internal limit is always higher than the system limit. This means that the
length of the queue always follows /proc/sys/net/ipv4/tcp_max_syn_backlog.
2016-11-16 15:25:10 +02:00