3420 Commits

Author SHA1 Message Date
Markus Mäkelä
3d8f946e19
Take dump_stacktrace into use
MaxScale and tests now both use the same code to dump stacktraces.
2018-06-22 13:59:57 +03:00
Markus Mäkelä
7254a7c525
Make maxutils a standalone library
The only way to cleanly separate the maxutils library from the MaxScale
CMake project is to make it a standalone CMake project. With the help of
ExternalProject, it should be relatively easy to use.
2018-06-22 13:59:57 +03:00
Markus Mäkelä
b96228f95c
Merge branch '2.2' into develop 2018-06-22 10:44:39 +03:00
Markus Mäkelä
e561c3995c
Use correct write in Backend::execute_session_command
Backend::execute_session_command would use the overridden write method
instead of the Backend::write method that it intended to use. This caused
session commands that did not expect a response to be in a state that
expected a result.

Also fixed RWBackend::write pass the response_type value to
Backend::write.
2018-06-22 10:37:11 +03:00
Johan Wikman
998798c90c Make test_event more reliable
Look for the expected message several times, with short sleeps in
between. That way we will not sleep more than necessary, yet will
not immediately give up either.
2018-06-21 15:42:50 +03:00
Markus Mäkelä
75ddfe4c14
Merge branch '2.2' into develop 2018-06-21 14:02:00 +03:00
Johan Wikman
45bda0f72e MXS-1936 Make qc_mysqlembedded compatible with qc_sqlite
qc_mysqlembedded must also be updated to handle the new type
QUERY_TYPE_DEALLOC_PREPARE. Some adjustements were also needed
elsewhere.
2018-06-21 12:51:47 +03:00
Markus Mäkelä
92b1767fb1
Merge branch '2.2' into develop 2018-06-21 11:45:23 +03:00
Markus Mäkelä
396f5d96c2
Merge branch '2.2' into develop 2018-06-20 14:43:03 +03:00
Markus Mäkelä
28ae1bf24e
MXS-1932: Ignore hidden files in maxscale.cnf.d
All files that are hidden (i.e. start with a period) are now ignored by
the configuration file processing.
2018-06-20 14:41:55 +03:00
Johan Wikman
68e514f08b Fix test_event
If the logged line is found, it is not an error, if it is not,
it is.
2018-06-20 13:01:20 +03:00
Markus Mäkelä
026313fcc7
Clear status bits of server that are down
At the start of the monitor tick, the monitor pending status is set to the
value of the current server status. This allows the informative and
history bits to survive even if a server goes down.

To make sure that no stale state bits are in effect when the post_tick
method is called, the pending status must be cleared of all status bits.
2018-06-18 14:25:05 +03:00
Markus Mäkelä
13893cca3d
MXS-1914: Move maxscale_shutdown() into the core
The core library now contains the maxscale_shutdown() command. This makes
it possible to resolve all symbols at link time even for administrative
modules.
2018-06-18 12:58:50 +03:00
Markus Mäkelä
df24f09ce5
Merge branch '2.2' into develop 2018-06-18 11:39:10 +03:00
Johan Wikman
6dd479104f MXS-421 Enable the turning on of events 2018-06-18 11:32:50 +03:00
Johan Wikman
6e3d3c0dcf MXS-421 Test that used facility has an effect
If the facility of an event is LOG_AUTH, it should by default
end up in /var/log/auth.log.
2018-06-18 11:32:50 +03:00
Johan Wikman
4c1b7f761c MXS-421 Add maxscale::event concept
MaxScale now defines events for which the syslog
facility and level can explicitly be defined by the
administrator. Currently there is only one such
event, namelt AUTHENTICATION_FAILURE.

In a subsequent commit, config.cc will be modified so
that event-related configuration parameters are passed
to event::configure() and in another subsequent commit
the authenticators will be modifed to use this mechanism.

In practice a line like:

   MXS_WARNING("%s: login attempt for user '%s'@[%s]:%s, "
               "authentication failed.",
               dcb->service->name, client_data->user,
               dcb->remote, dcb->path);

will be changed to

    MXS_LOG_EVENT(event::AUTHENTICATION_FAILURE,
                  "%s: login attempt for user '%s'@[%s]:%s, "
                  "authentication failed.",
                  dcb->service->name, client_data->user,
                  dcb->remote, dcb->path);
2018-06-18 11:32:50 +03:00
Markus Mäkelä
ca155fbfe9
Merge branch '2.1' into 2.2 2018-06-18 11:32:13 +03:00
Markus Mäkelä
8721c9117a
Expose function for checking MYSQL connection errors
If a query done via the connector fails, the return value can be inspected
with the function. This helps separate fatal problems from transient ones.
2018-06-16 23:29:39 +03:00
Markus Mäkelä
2005164222
Fix slave reconnection logic
Allowing calls to select_connect_backend_servers even when all slaves are
connected solves the debug assertion in select_connect_backend_servers
that happens when the execution of a queued query causes a new connection
to be created.
2018-06-15 16:16:53 +03:00
Markus Mäkelä
3ed6411741
Fix debug assert on reconnection with session commands
When a query was routed to a server that must first be connected to, the
expected response count was not updated for the executed session commands.
2018-06-15 16:16:53 +03:00
Johan Wikman
bed1c60fd4 MXS-421 Allow specifying a facility when logging
In principle a syslog priority consists of a syslog level
bit-or:d with a syslog facility. That's clear from the syslog
man page, but not so clear from the code in syslog.h.

Anyway, to make it possible to log using a specific facility
(instead of the default LOG_USER), we must allow priorities
that include a specified facility.
2018-06-15 12:41:52 +03:00
Markus Mäkelä
a983df5a7e
Fix testlogthrottling compilation failure
The ifstream constructor for some reason doesn't understand strings.
2018-06-15 11:45:40 +03:00
Markus Mäkelä
a812e02ba4
Merge branch '2.2' into develop 2018-06-15 10:48:07 +03:00
Markus Mäkelä
4cc4deeaf1
MXS-1843: Test log throtting in a unique directory
This rules out external influence as a reason for the test failure.
2018-06-15 10:07:49 +03:00
Markus Mäkelä
3d1c2b421a
MXS-1921: Explain why session was closed
When a client connection is closed by MaxScale before the client initiates
a controlled closing of the connection, an error message is sent. This
error message now also explains why the connection was closed to make
problem resolution easier.
2018-06-14 13:48:07 +03:00
Markus Mäkelä
bbeaaa97b5
Merge branch '2.2' into develop 2018-06-13 23:18:52 +03:00
Markus Mäkelä
1475b22eac
Upgrade REST-API npm packages
Upgraded packages to more recent versions.
2018-06-13 10:07:37 +03:00
Markus Mäkelä
8094c67ac2
Merge branch '2.2' into develop 2018-06-13 00:25:56 +03:00
Markus Mäkelä
24870e278c
MXS-1913: Check session before invoking dcb_foreach callback
If the session is the dummy session, the callback should not be called.
2018-06-12 23:55:30 +03:00
Markus Mäkelä
780620e796
Only use __atomic builtins
Now that the compiler for CentOS 6 was upgraded, there is no need to
support the old __sync builtins.
2018-06-12 19:40:34 +03:00
Johan Wikman
8f9bf100e1 MXS-1918 Remove HASHTABLE from dcb.cc 2018-06-12 17:32:35 +03:00
Johan Wikman
ee03ffd7db MXS-1917 Replace HASHTABLE with std::set 2018-06-12 17:32:01 +03:00
Johan Wikman
69b19d1473 Remove unnecessary includes of hashtable.h
And add where necessary.
2018-06-12 11:02:29 +03:00
Johan Wikman
6cc03afdf9 MXS-1908 Reorder the code slightly 2018-06-12 10:49:05 +03:00
Johan Wikman
9a11394f22 MXS-1908 Rename classes
- MessageStats      -> MessageRegistry
- MessageStatsKey   -> MessageRegistryKey
- MessageStatsValue -> MessageRegistryStats
2018-06-12 10:49:05 +03:00
Johan Wikman
690999c4af MXS-1908 Turn LM_MESSAGE_STATS into a class 2018-06-12 10:49:05 +03:00
Johan Wikman
9f64c73bb4 MXS-1908 Turn LM_MESSAGE_KEY into a class 2018-06-12 10:49:05 +03:00
Johan Wikman
9e3b4b46fc MXS-1908 Replace HASHTABLE with std::unordered_map
Just minimal changes, further cleanup and simplification could
be done.
2018-06-12 10:49:05 +03:00
Esa Korhonen
d0453bd3ed Measure monitor loop execution time when calculating sleep time 2018-06-11 13:30:36 +03:00
Markus Mäkelä
96ed651466
Merge branch '2.2' into develop 2018-06-11 11:28:36 +03:00
Markus Mäkelä
1a24f0a956
Merge branch '2.1' into 2.2 2018-06-11 10:36:57 +03:00
Markus Mäkelä
1e1734f42e
MXS-1910: Only require ssl_ca_cert for servers
Servers in MaxScale can encrypt the connections without client keys and
certificates. As keys and certificates are no longer required, the CA
certificate must always be initialized.
2018-06-09 00:15:48 +03:00
Markus Mäkelä
9f5358eac0
Remove server_get_parameter_nolock
The function is no longer needed as there is no recursive access to the
server.
2018-06-08 14:41:11 +03:00
Markus Mäkelä
e9dee55245
Fix improper use of the metadata pointer
The value was unconditionally dereferenced even if the data type did not
have metadata. In this case the pointer would point to unallocated memory
which can lead to a crash.
2018-06-08 12:18:12 +03:00
Markus Mäkelä
0d73530ff3
Merge branch '2.2' into develop 2018-06-08 11:30:55 +03:00
Markus Mäkelä
a7dd2127d6
Merge branch '2.1' into 2.2 2018-06-08 11:21:35 +03:00
Markus Mäkelä
c850336199
MXS-1907: Allow ssl_verify_peer_certificate when creating listener
When a listener is created at runtime or SSL is being enabled for an
already created listener, the ssl_verify_peer_certificate parameter can
now be defined.
2018-06-08 10:11:43 +03:00
Johan Wikman
8afa8c2c5a MXS-1775 Add MonitorInstanceSimple class
MonitorInstanceSimple is intended for simple monitors that
probe servers in a straightforward fashion. More complex monitors
can be derived directly from MonitorInstance.
2018-06-07 15:13:26 +03:00
Marko
880db1353a Merge branch '2.2' into develop 2018-06-07 14:39:16 +03:00