5691 Commits

Author SHA1 Message Date
Markus Mäkelä
bd3e2904e7 MXS-1405: Log subprocess output according to log level
If the executed subprocess prefixes its output with either `error:`,
`warning:` or `info:`, the message will be logged on the appropriate
level. If no prefix is provided, the message is logged on the notice
level.
2017-09-18 11:39:33 +03:00
Markus Mäkelä
130b686d9b MXS-1405: Log subprocess output immediately
When the subprocess outputs a line, the message should be logged
immediately. This allows automated timestamps for the output of the
executed subprocess.
2017-09-18 11:39:33 +03:00
Markus Mäkelä
7e6e8d3e29 MXS-1405: Capture subprocess output
The output by the subprocesses launched by the externcmd system is now
captured and logged.
2017-09-18 11:39:33 +03:00
Markus Mäkelä
9267f8ad70 MXS-1418: Keep connections open if server is removed
The removal of a server from a service is intended to affect only new
sessions.

Added a test that checks that the connections are kept open even if the
server is removed from the service.
2017-09-16 07:28:17 +03:00
Markus Mäkelä
d00c5b2838 Move thread initialization into Worker::run
By moving the initialization into Worker::run, all threads, including the
main thread, are properly initialized. This was not noticed before as
qc_sqlite initialized the main thread in the process initialization
callback.
2017-09-15 18:08:49 +03:00
Johan Wikman
d1b742eaa5 Log details if cache received unexpected packet from server 2017-09-15 17:14:21 +03:00
MassimilianoPinto
fb12e4c0aa MXS-1411: additional fix to error message
MXS-1411: additional fix to error message
2017-09-15 15:30:39 +02:00
MassimilianoPinto
9dd7f2174c MXS-1412: while discarding a result set don't buffer any data.
MXS-1412: while discarding a result set don't buffer any data: this
avoids to store useless data.

Additionally the colum definitions buffer is used instead of the offset
value.
2017-09-15 12:05:28 +02:00
MassimilianoPinto
8905c3aa34 MXS-1411: fix error message and log priority
MXS-1411: fix error message and log priority
2017-09-14 15:33:39 +02:00
Markus Mäkelä
099a482f04 Add missing default case to masking filter
The default case for the PS field values was missing.
2017-09-14 15:30:44 +03:00
Markus Mäkelä
616a1e0736 Add missing getopt.h include into maxpasswd.c
The file did not explicitly include the header and thus depended on it
being included by another header.
2017-09-14 15:30:43 +03:00
Markus Mäkelä
45e0e8bb59 Introduce internal protocol command enum
The enums exposed by the connector are not intended to be used by the
users of the library. The fact that the protocol, and other, modules used
it was in violation of how the library is intended to be used.

Adding an internal mapping into MaxScale also removes some of the
dependencies that the core has on the connector.
2017-09-14 15:30:43 +03:00
Markus Mäkelä
3676dcebb1 MXS-1398: Clean up mysql.h header
Cleaned up the MaxScale version of the mysql.h header by removing all
unused includes. This revealed a large amount of dependencies on these
removed includes in other files which needed to be fixed.

Also sorted all includes in changed files by type and alphabetical
order. Removed explicit revision history from modified files.
2017-09-14 15:30:43 +03:00
Markus Mäkelä
fe40511d97 MXS-1405: Take script_timeout into use
The script_timeout parameter is now used by all monitors.
2017-09-14 12:34:34 +03:00
Markus Mäkelä
7e48941a04 MXS-1412: Process response buffers individually
By processing each buffer individually, the need to iterate over the whole
resultset is removed. Profiling showed that most of the time was spent
navigating the linked list of buffers when an offset into the whole
resultset was used instead of an offset to the individual response buffer.
2017-09-14 09:50:05 +03:00
Markus Mäkelä
097f1b4613 MXS-1405: Move externcmd documentation to header
The function documentation is more useful in the public header.
2017-09-13 22:54:26 +03:00
Markus Mäkelä
4f7606ebc0 MXS-1405: Execute EXTERNCMD synchronously
The execution of external commands in MaxScale by monitors needs to be
synchronous in order to prevent the unintended detection of state changes.
2017-09-13 22:51:53 +03:00
Markus Mäkelä
efb1e541e2 Add missing DbfwThread initialization
The thread objects didn't initialize the rule version to the proper value.
2017-09-13 18:03:43 +03:00
MassimilianoPinto
3df5e6f137 Fix CHANGE MASTER TO with binlog server state BLRM_UNCONFIGURED
Fix CHANGE MASTER TO with binlog server state BLRM_UNCONFIGURED
2017-09-13 15:51:35 +02:00
MassimilianoPinto
7e1e63aef6 The poll_fake_write_event() ins no longer needed after the blr_slave_fake_rotate() call
Also removed some useless branches with ‘record’ pointer being not NULL
2017-09-13 13:57:56 +02:00
Johan Wikman
a2d0d24b2c Merge branch '2.1' into develop
Bringing in MXS-1406
2017-09-13 10:02:37 +03:00
Markus Mäkelä
16d3eab59f Merge branch '2.1' into develop 2017-09-12 22:42:11 +03:00
Markus Mäkelä
0f3a13e6ac Remove unused binlogrouter variables
The unused variables cause compilation to fail.
2017-09-12 22:32:40 +03:00
Johan Wikman
49ab5797a2 MXS-1406 Report CALL operation
Basically it would be trivial to report far more operations
explicitly, but for the fact that the values in qc_query_op_t
currently, quite unnecessarily, form a bitmask.

In 2.2 that is no longer the case, so other operations will be
added there.
2017-09-12 15:38:25 +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ä
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
Johan Wikman
02b9e0a01d Merge branch '2.1.7' into develop-2.1-merge 2017-09-12 11:08:02 +03:00
Markus Mäkelä
4a42ddfe5f Null-terminate decrypted passwords
The decrypted passwords returned by `decrypt_password` are now properly
null-terminated.
2017-09-12 09:29:26 +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ä
81202eac89 MXS-1400: Fix crash with OpenSSL 1.1
Added the missing parameter for the RSA key generation function.
2017-09-11 12:50:24 +03:00
Markus Mäkelä
9ceb23dd65 MXS-1396: Fix persistent connection hangs
When a COM_CHANGE_USER was executed, it is possible that the server
responds with a AuthSwitchRequest packet instead of an OK packet. In this
case, the server sends a new scramble which must be used to create the 20
byte hash that is expected as the response.
2017-09-11 12:50:24 +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ä
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ä
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ä
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ä
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
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
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