11364 Commits

Author SHA1 Message Date
Markus Mäkelä
39ce6c624f
MXS-2005: Remove unused code
Removed skygw_utils and relate files along with the old log manager
code. Also removed file flushing due to it being redundant; messages are
written to the file immediately. Adjusted tests to accommodate this
change.
2018-08-14 14:57:33 +03:00
Markus Mäkelä
fd5a2305e4
MXS-2005: Take Logger into use in log_manager
The log manager now uses the logger type for logging. Removed some of the
code that depended on the renamed functions to make it compile. The next
step is to remove all unused code in the log manager.
2018-08-14 14:57:33 +03:00
Markus Mäkelä
1326b3a950
MXS-2005: Add Logger class
The interface defines a very simple logging API. The main logger,
FileLogger, implements a very basic logger that writes to a file. The
StdoutLogger implements a logger that simply writes to stdout.

The logging to shm could be implemented quite easily but the usefulness of
it is very questionable and it has the problem of losing log files on a
server shutdown. A ring buffer of INFO messages would be more useful and
would provide a way to limit the amount of memory used for it.
2018-08-14 14:57:33 +03:00
Markus Mäkelä
32b1711684
MXS-2005: Remove logging to shared memory
The feature was rarely used and was only useful in extremely rare
cases. The functionality can still be emulated, if for some reason needed,
by pointing `logdir` to `/dev/shm` or another tmpfs mount.
2018-08-14 14:57:33 +03:00
Johan Wikman
4fdec4d1f3 MXS-2004 Replace pthread_self() with std::this_thread::get_id() 2018-08-13 13:38:39 +03:00
Johan Wikman
0c56be1e58 MXS-2004 Remove maxscale/thread.h and server/core/thread.cc
Not used anymore.
2018-08-13 13:38:39 +03:00
Johan Wikman
e075fcefcb MXS-2004 thread_stack_size is deprecated AND ignored 2018-08-13 13:38:39 +03:00
Johan Wikman
2dd9e3e382 MXS-2004 Remove remaining dependency on maxscale/thread.h
Replaced with explicit dependency on pthread.h. Acceptable since
this is effectively for debugging purposes and could at some point
be removed entirelly.
2018-08-13 13:38:39 +03:00
Johan Wikman
f9ba8824d4 MXS-2004 Remove additional dependencies on maxscale/thread.h 2018-08-13 13:38:39 +03:00
Johan Wikman
5d6b05af1f MXS-2004 Change tpmfilter to use std::thread instead of THREAD
The bare minimum of changes; there seem to be numerous races in
the thread function.
2018-08-13 13:38:39 +03:00
Johan Wikman
7ef163477a MXS-2004 Change unit tests to use std::thread 2018-08-13 13:38:39 +03:00
Johan Wikman
b408894f6d MXS-2004 Remove dependency of maxscale/thread.h 2018-08-13 13:38:39 +03:00
Johan Wikman
e978387775 MXS-2004 Replace THREAD with std::thread in log_manager.cc 2018-08-13 13:38:39 +03:00
Johan Wikman
47b53aae55 MXS-2004 Replace THREAD with std::thread in Worker 2018-08-13 13:38:39 +03:00
Johan Wikman
6db03d4b29 MXS-2004 Drop support for thread_stack_size
- Cannot be supported with std::thread.
- Unlikely that the default size (8MB) would ever be too small and
  if it is, there is some problem.
- The stack size can be specified using 'ulimit -s' before starting
  MaxScale.
2018-08-13 13:38:39 +03:00
Johan Wikman
2515473fd4 MXS-2004 Replace THREAD with std::thread in housekeeper 2018-08-13 13:38:39 +03:00
Esa Korhonen
681c456bd7 Separate unknown server version from old versions
This allows better failover support detection.
2018-08-13 11:30:21 +03:00
Esa Korhonen
ddc422b102 MonitorInstance::diagnostics_json() should return an empty object
Some of the inheriting classes call the base class diagnostics_json
when constructing their own diagnostics data.
2018-08-13 11:30:21 +03:00
Esa Korhonen
e5a90d63e1 Remove SERVER_WAS_SLAVE status bit
Was unused due to MariaDBMonitor changes.
2018-08-13 11:30:20 +03:00
Esa Korhonen
eab0a22518 Use parameters list when converting monitor parameters to json
The json conversion now processes the general monitor parameters similarly
to the module-specific settings.
2018-08-13 11:18:04 +03:00
Markus Mäkelä
1572e088bf
Run REST API and MaxCtrl unit tests
Install Docker when building on CentOS 7. This allows the REST API and
MaxCtrl unit tests to be run.
2018-08-13 10:54:25 +03:00
Markus Mäkelä
f90b8cdafb
Fix race condition in session.cc
The dummy session was unnecessarily modified by multiple threads at the
same time. The state of the dummy session must not change once it's been
set at startup.
2018-08-13 10:37:48 +03:00
Markus Mäkelä
2852530893
Use standard RNG
The custom random number generator can now be replaced with a C++11
RNG. This greatly improves the reliability and trustworthiness of it.

In addition to this, the conversion of the RNG to a thread-local object
removes the race condition that was present in the previous
implementation. It also theoretically improves performance by a tiny bit.
2018-08-13 10:37:48 +03:00
Markus Mäkelä
4017466527
Disable SQLite memory statistics for qc_sqlite
The default value can be set at compile time. This prevents a race condition that TSAN reports in the
2018-08-13 10:37:48 +03:00
Markus Mäkelä
4a47b4f334
Fix ssl_version
The parameter used wrong keywords for the enum values. The comparison
should be changed to be case-insensitive to prevent similar problems.
2018-08-13 10:28:04 +03:00
Markus Mäkelä
33488e1a1f
Update Connector-C version
There are various bug fixes for TLS/SSL connections as well as
reconnections. A large number of compiler warnings were also removed.
2018-08-13 10:28:04 +03:00
Markus Mäkelä
804991404e
Rewrite stale_slaves
The behavior of mariadbmon was changed so that it better understands
slaves attempting to replicate. Rewrote the test to accommodate the change
in behavior and take the opportunity to use newer code.
2018-08-13 10:28:04 +03:00
Markus Mäkelä
cef305e598
MXS-1929: Fix version_string
The new default value was not copied to the old value.
2018-08-13 10:28:04 +03:00
Markus Mäkelä
c984381662
Use devtoolset 7
As devtoolset 6 worked on CentOS 6, upgrading to devtoolset 7 is better as
it will be supported for a longer time.
2018-08-13 10:28:03 +03:00
Markus Mäkelä
57471c7baa
Improve MaxCtrl test coverage
A few missing cases that simple to solve were reported by the coverage
tool.
2018-08-13 10:28:03 +03:00
Markus Mäkelä
46dee98b25
MXS-1929: Report runtime module loading errors to users
If a module is not found, a proper error message is now given to the
user. Other system errors are also printed if errno is set. Dynamic
library errors aren't printed as they are apparently reset after a call to
`dlerror`, at least according to documentation.
2018-08-13 10:28:03 +03:00
Markus Mäkelä
064ad8fa4f
Improve MaxScale startup and shutdown in NPM tests
The tests are now less violent in how they stop MaxScale. Also the logs
are now removed before a new test run is executed.
2018-08-13 10:28:03 +03:00
Markus Mäkelä
3bbf58ad1f
Update MaxCtrl packages
Updated needed and pruned unneeded dependencies from maxctrl. Also updated
the packages in the REST API test suite.
2018-08-13 10:28:03 +03:00
Markus Mäkelä
06df290aeb
Use DevToolSet 6 with CentOS 6
DevToolSet 4 was EOL'ed December 2017.
2018-08-13 10:28:02 +03:00
Markus Mäkelä
c1f930d23d
Fix query classifier initialization data race
The initialization code does some modification to the global code
(something about a page cache) and causes warnings with TSAN.
2018-08-13 10:28:02 +03:00
Markus Mäkelä
70fa300fe1
Remove unnecessary mxs_log_flush_sync calls
The calls were unnecessary in the context where they were made.
2018-08-13 10:28:02 +03:00
Markus Mäkelä
cb990f28dc
Remove dead log_manager code
SS_LOG_DEBUG was never defined.
2018-08-13 10:28:02 +03:00
Markus Mäkelä
8b39373577
MXS-1929: Document readwritesplit runtime changes
Added a note about the new behavior in 2.3.
2018-08-13 10:28:01 +03:00
Markus Mäkelä
4fc6b43fb3
Update pkg version
Using the newer version removes the deprecation warnings for some of the
packages.
2018-08-13 10:28:01 +03:00
Markus Mäkelä
09239a1c7a
MXS-1929: Update REST API documentation for filters
Added the DELETE and clarified the POST documentation.
2018-08-13 10:28:01 +03:00
Markus Mäkelä
f9e5d3135d
Allow null parameter values
If a resource parameter is defined as a null JSON value, it is ignored.
2018-08-13 10:28:01 +03:00
Markus Mäkelä
8bbc2c3f33
MXS-1929: Clarify service destruction
The prgress of service destruction can be monitored via the `sessions`
endpoint.
2018-08-13 10:28:01 +03:00
Markus Mäkelä
a399c58df3
Make NPM tests runnable by root
The tests can now be run as root. This is most likely required in some
cases and it should not break things if they are run as root (e.g. inside
a VM with no other users).

NPM prevents the use of the root user (due to modules getting root access)
and uses an unprivileged user to install the modules. As maxctrl has to
generate the version information at install time, running `npm install` as
root will fail due to missing privileges to the current working
directory. To work around this, an explicit step was added.

Also changed the maxadmin checks to maxctrl to remove the dependency on
the socket file location being writable by non-root users
(/var/run/maxscale/ might not be accessible to all users).
2018-08-13 10:28:00 +03:00
Markus Mäkelä
c495abcca7
Remove excessive platform checks
The constants set by the header checks aren't used and removing them cuts
the configuration time in about half (from 5 to roughly 2 second).
2018-08-13 10:28:00 +03:00
Markus Mäkelä
7438a0f186
Remove unnecessary MaxScale parts for NPM tests
Some of the CMake arguments were redundant, unnecessary or just a
hindrance to testing.
2018-08-13 10:28:00 +03:00
Johan Wikman
e2902b6513 MXS-2002 Remove GenericFunction typedef
It does not save much in characters compared to std::function<void ()>
and it's a bit misleading as not just any callable object will do, but
only one that takes no argument and returns void.
2018-08-13 08:30:05 +03:00
Johan Wikman
43b53fda7a MXS-2002 Replace task with std::function 2018-08-13 08:30:05 +03:00
Johan Wikman
4193c4d3db MXS-2002 Add additional versions of Worker::[call|execute]() 2018-08-13 08:30:05 +03:00
Johan Wikman
e9758ebaf1 MXS-2002 Rename Worker::post() to Worker::execute()
The main point is that tasks/functions are executed, not that
they are posted.
2018-08-13 08:30:05 +03:00
Johan Wikman
3013adb14f MXS-2002 Worker::execute() renamed to Worker::call()
In preparation for Worker::post() to be renamed to Worker:execute().
The concept of _posting_ will be reserved to mean the transfer of
something over the message queue to the worker for processing and
nothing else.
2018-08-13 08:30:05 +03:00