The service configuration serialization now uses the helper functions from
config.hh. This fixes the failing test mxs1731_old_persisted_config and
improves the readability of persisted configuration files.
Converted parameters into booleans that were used like booleans. This
forced the removal of the automatic enabling of
localhost_match_wildcard_host but since it has been enable by default,
this change should have no practical effects.
In addition to the clarification of the persisted configurations, this
change will limit the negative side-effects of changing a configuration
value in the main configuration file after a runtime modification has been
made. If a value has not been modified at runtime, changes to it in the
main configuration will take effect.
Previously, a runtime modification prevented all further manual changes to
the configuration file. Although in theory this sounds good, in practice
this does very little to improve the situation: The only reliable way to
change a parameter after a runtime modification is to do it via the REST
API (or MaxAdmin).
The functions dump of parameters only if they differ from the
defaults. The check for equality is rather coarse but it should work as
long as all core objects use C++ types correctly e.g. integer are not used
to store boolean values (I'm looking at you, enable_root and
localhost_match_wildcard_host). The boolean type has a specialization to
convert the value to the string format used for all defaults in the core.
This also adds the missing return value checks to the dprintf calls and
reports errors if any are encountered.
The logging of syslog messages is now done outside of the log_write
function. This removes the need to pass the prefix length as an
argument. With this change, the log_write function only writes MaxScale
log messages.
Also reworked the timestamp generation functions so that they return a
string. This greatly simplifies the message writing.
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.
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.
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.
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.
Replaced with explicit dependency on pthread.h. Acceptable since
this is effectively for debugging purposes and could at some point
be removed entirelly.
- 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.
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.
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.
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.
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.