8617 Commits

Author SHA1 Message Date
Markus Mäkelä
0f3a13e6ac Remove unused binlogrouter variables
The unused variables cause compilation to fail.
2017-09-12 22:32:40 +03:00
MassimilianoPinto
43d5f67a76 MXS-1383: fix for some change master to MASTER_LOG_FILE, POS settings that fail.
MXS-1383: fix for some change master to MASTER_LOG_FILE, POS settings
that fail.
2017-09-12 14:33:10 +02:00
MassimilianoPinto
e0c85d02fa Minor fixes for testbinlog.c
Minor fixes for testbinlog.c
2017-09-12 14:33:10 +02:00
Markus Mäkelä
b18c0ed0b8 Assign worker ID in dcb_alloc
Apart from listeners, all DCBs will be assigned to the current
thread. This simplifies the addition of DCBs to worker threads.

Also performed a small cleanup of poll_add_dcb to make it more readable.
2017-09-12 15:14:51 +03:00
Johan Wikman
d2f790a06c Merge remote-tracking branch 'origin/develop' into develop 2017-09-12 11:22:10 +03:00
Markus Mäkelä
3841205704 Update mxs729_maxadmin
The test expected the old result for the test.
2017-09-12 11:17:19 +03:00
Markus Mäkelä
16127d893c Fix compilation failures on CentOS 6
Thread-local non-POD types are not supported on CentOS 6 and thus they
need to be replaced with pointers to the relevant objects and initialized
at runtime.

In addition to this, functor objects don't appear to work as expected in
CentOS 6 and replacing them with a simple for-loop seems to work.
2017-09-12 11:17:19 +03:00
Markus Mäkelä
20d9a60cbb Don't remove util-linux-dev
The util-linux-dev package on Alpine Linux provides the libuuid.so library
and thus it must not be removed.
2017-09-12 11:17:19 +03:00
Johan Wikman
02b9e0a01d Merge branch '2.1.7' into develop-2.1-merge 2017-09-12 11:08:02 +03:00
Markus Mäkelä
2a4bfc31ec Backport mxs1110_16mb fixes to 2.1
Backported changes to mxs1110_16mb from develop into 2.1.
2017-09-12 09:58:20 +03:00
Markus Mäkelä
eb157a3afe Fix bug519
The test attempted to copy the generated CSV file from the MaxScale server
when in fact it was on the master server. Removed HEAVY label from the
test as it takes about 10 seconds to run.

Cherry-picked from commit f80cde2af149fda9c47d8f9131f82527b76af487.
2017-09-12 09:58:20 +03:00
Markus Mäkelä
40f846cbb0 Add MXS-1396 into 2.1.7 release notes
The bug was included in the 2.1.7 tag but it was not in the release notes.
2017-09-12 09:28:54 +03:00
Johan Wikman
65066ae126 Call drain callback only if drained
In case of write errors the write queue will not be drained. In
that case callbacks should not be called.
2017-09-11 16:56:47 +03:00
Markus Mäkelä
730072e2ef Add format checks for printf-style functions
Added format checks to functions that expect printf style arguments and
fixed any broken calls to these functions.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
b5202a99f4 Move create TLS parameters to common section
The TLS parameters are now shared by both servers and listeners.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
dd178875a3 Log OpenSSL errors when SSL initialization fails
When the SSL fails to initialize, the errors from OpenSSL should be
logged. This helps to diagnose what is wrong if the error relates to the
certificate files or private keys.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
3ca172f380 MXS-1390: Clean up services resource documentation
Cleaned up the documentation and reformatted the parameter list of
listener creation to be made out of links.

Added some comments to the resource declarations in resource.cc to prevent
the order of them from being altered.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
1a196bc865 MXS-1390: Add SSL documentation to servers resource
The servers resource now shows the SSL parameters in the example
output. It also lists the parameters in the list of valid values for
parameters in the server creation section.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
486024aaf4 MXS-1390: Add missing SSL parameter processing to servers resource
Added missing SSL parameters to servers resource output as well as added
the processing of these parameters when servers are created. It is
preferable to define servers as either encrypter or plain and to prevent
the modification of this at runtime.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
3d5ac7e32d Clean up variable types in config_runtime.cc
Used std::string and created a typedef for std::set<std::string>.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
819a76dea9 Fix broken link in Documentation-Contents.md
The notification service document was removed.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
6b27111eab MXS-1390: Update monitor resource documentation
Added missing DELETE request documentation and cleaned up formatting.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
81a3ff6c27 Fix REST API authentication errors
The authentication errors were not sent as the connection was closed
immediately. The reason for this was the fact that if a client request
uploaded data with bad credentials, MaxScale would not send a response if
the connection was kept open. Closing the socket solved the hang but
caused confusing errors on the client side.

The libmicrohttpd library appears to require full processing of any data
uploaded by a client request before a request can be sent. With this
change, the clients receive proper authentication errors in all cases.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
5abb30c357 MXS-1390: Add missing self-link to module command output
The module commands now produce functional self-links. The links most
often require parameters so they are not of great use.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
6cf90ceb15 MXS-1390: Update MaxAdmin documentation
Added the missing documentation for the alteration of
admin_log_auth_failures.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
d8e88af017 MXS-1390: Update MaxScale and service resource documentation
Added module command and individual listener resource
documentation. Cleaned up formatting of values in the MaxScale resource
document.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
c0411445a8 MXS-1390: Update users resource documentation
Updated the users resource documentation with the new changes that were
added when user authorization was added.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
d2b474e021 Fix enabled admin users being shown as basic users
The enabled admins for the Linux users were shown as basic users. This was
caused by the separation of the two admin types.

Added tests that check that enabled Linux accounts show the correct type
in the output.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
a3402dfebf MXS-1390: Update main REST API document
Updated the document and removed faulty information.
2017-09-11 12:49:11 +03:00
MassimilianoPinto
847496d4fa Fix for testbinlog.c library set and object creation checks
Fix for testbinlog.c library set and object creation checks
2017-09-11 10:02:15 +02:00
Johan Wikman
5337a5092f Update release date for 2.1.7 2017-09-11 10:55:01 +03:00
MassimilianoPinto
6606983181 MXS-1383: abort slave connection if requested filename doesn't exist
MXS-1383: abort slave connection if requested filename doesn't exist
2017-09-08 18:43:01 +02:00
MassimilianoPinto
9617119aa9 Added blr_abort_change_master() routine
Added blr_abort_change_master() routine
2017-09-08 14:25:09 +02:00
MassimilianoPinto
ac0de09c7c Fix log message when GTID is in use
Fix log message when GTID is in use
2017-09-08 14:25:09 +02:00
Johan Wikman
402b27ad01 MXS-1392 Remove remnats of DCB reference counting 2017-09-08 12:41:41 +03:00
Johan Wikman
70a4ad6532 MXS-1392 Take new zombie mechanism into use
Next commit will remove the remnants of the reference counting
mechanism.
2017-09-08 12:41:41 +03:00
Johan Wikman
8414ce6e80 MXS-1392 Re-introduce zombie queue
- Extend Worker interface so that zombies can be registered
- Call deletion function at the end of event loop
2017-09-08 12:41:41 +03:00
Johan Wikman
be94066b77 MXS-1392 Manage DCB lifetime using refcounts
Now it is also possible to ensure that a DCB stays alive while
a task referring to it is posted from one worker to another.
That will be implemented in a subsequent commit.
2017-09-08 12:41:41 +03:00
Johan Wikman
bf42d845cf MXS-1392 Remove dcb_free
Not used and with reference counting it must not be available either.
2017-09-08 12:41:41 +03:00
Johan Wikman
7e17e2cd56 MXS-1392 Add reference count to MXS_POLL_DATA
The polling mechanism can now optionally be used for managing
the lifetime of an object placed into the poll set.

If a MXS_POLL_DATA has a non-null 'free', then the reference count
of the data will be increased before calling the handler and
decreased after. In that case, if the reference count reaches 0,
the free function will be called.

Note that the reference counts of *all* MXS_POLL_DATAs returned
by 'epoll_wait' will be increased before the events are delivered
to the handlers individually for each MXS_POLL_DATA, and then once
all events have been delivered, the reference count of each
MXS_POLL_DATA will be decreased.

This ensure that if there are interdependencies between different
MXS_POLL_DATAs returned by one call to 'epoll_wait', the case that
an MXS_POLL_DATA is deleted before its events have been delivered
can be avoided by using the reference count for lifetime management.

In subsequent commits, the reference count will be taken into use
in the lifetime management of DCBs.
2017-09-08 12:41:41 +03:00
MassimilianoPinto
daef8ad5d7 With GTID master registration always get filename from GTID repo
With GTID master registration always get filename from GTID repo.

The filestem option is not written if binlog_name is not set: this is
not needed by GTID registration.
router->fileroot is set when last name is loaded from GTID repo.
2017-09-08 10:48:35 +02:00
Markus Mäkelä
1e2e43a96e MXS-1389: Add test for uses_function
The test uses a uses_function type rule to restrict access to the name and
address columns.
2017-09-08 09:31:38 +03:00
Markus Mäkelä
bca1e34d27 MXS-1389: Add missing basic rule type
The basic rule type that matches everything was not created when a rule
with only an optional part was defined. This caused a crash when only one
rule with only an optional part was created. This was caused by the
expectation that the list of rules was never empty.
2017-09-08 09:31:38 +03:00
Markus Mäkelä
a4975edbba MXS-1389: Fix rule reloading and query parsing requirements
Reloading of rules now properly uses the current rule file if no argument
was provided. The rule version counter also used atomic operations for the
sake of correctness.

The rule parsing is now only required for DML type statements that should
be fully parsed.
2017-09-08 09:31:38 +03:00
Markus Mäkelä
26f0c08522 MXS-1389: Allow mandatory commands to pass
All commands that are deemed mandatory must be allowed to pass through the
filter.
2017-09-08 09:31:38 +03:00
Markus Mäkelä
f0a9866a87 MXS-1389: Fix fwf test SQL
The SQL executed by the test that was expected to pass wasn't correct
SQL. It appears that a CAST from an INTEGER to a TEXT value is not
possible.
2017-09-08 09:31:38 +03:00
Markus Mäkelä
a08179afcb MXS-1346: make value comparisons case-insensitive
All values for columns, function and function_usage rules should be
compared in a case-insensitive way.
2017-09-08 09:31:38 +03:00
Markus Mäkelä
40582c38fb MXS-1389: Fix fwf test rules
The new tests now use the correct syntax for the rule files.
2017-09-08 09:31:38 +03:00
Markus Mäkelä
a041bfcb5f Make the fwf test less verbose
The test was very verbose which made spotting the failure cases harder.
2017-09-08 09:31:38 +03:00
Markus Mäkelä
9ed0524699 MXS-1346: Fix at_times time period calculcation
The time period matched for one extra second.
2017-09-08 09:31:38 +03:00