Commit Graph

11605 Commits

Author SHA1 Message Date
930be8d77a Fix CMake problems in system test
The paths were wrong in the scripts used to run tests. The same problem
was in the CMake files that used CMAKE_SOURCE_DIR instead of
CMAKE_CURRENT_SOURCE_DIR.

Added missing check for BUILD_SYSTEM_TESTS in avrorouter for the
workaround to building without all dependencies present.
2018-08-20 13:56:58 +03:00
d428292ec0 Add workaround to building tests without all dependencies
The system tests can be build even if not all of the dependencies for
MaxScale are met.
2018-08-20 13:56:58 +03:00
67df3ad4f0 Use option() CMake command
This is the appropriate command for ON/OFF options controlled by the
user. Also removed the useless C99 option which must always be on (using
C11 would be another option).
2018-08-20 13:56:58 +03:00
0685276764 Use correct functions in maxutils CMake files
The headers and the static library were installed unconditionally.
2018-08-20 13:56:58 +03:00
40a5ae81c7 MXS-2008 Store worker as MXB_WORKER* and not void* 2018-08-20 11:15:14 +03:00
e0cb11151f MXS-2008 Move maxscale/worker.h to maxbase/worker.h 2018-08-20 11:15:14 +03:00
932956d5f6 MXS-2008 Add maxbase/poll.[h|hh]
Remove maxscale/poll_core.h
2018-08-20 11:15:14 +03:00
8f257a51fe MXS-2008 Remove unused headers from worker.hh
Add corresponding headers to files that depended on those headers.
2018-08-20 11:15:14 +03:00
aaad63ee5e MXS-2008 Move content of maxscale/platform.h to maxbase/cdefs.h
No good reason for keeping that platform adjustments anywhere
else but in cdefs.h.
2018-08-20 11:15:14 +03:00
90960ec07f Make Worker::run(mxb::Semaphore*) private
The semaphore is only used when Worker::start() is called to synchronize
the startup of the two threads. Also asserted that the state is what we
expected it to be.
2018-08-20 10:10:23 +03:00
c38dcff53c MXS-2019: Remove header and footer output
Now that the exit handlers work correctly, the output of `maxscale
--version` no longer consists of a single line but multiple lines in both
stdout and stderr. Removing the printing to stderr guarantees that the
correct output is produced.
2018-08-20 10:04:12 +03:00
57334153fe MXS-1880: Fix crash after restart
The offsets in the events were wrong if MaxScale was restarted in the
middle of a binlog. This was caused by the fact that the FDE event
contains information on binlog checksums which is required for a correct
interpretation of the binlog. The FDE event was only read when the binlog
was first opened when it needs to be read every time the binlog is opened.
2018-08-20 08:06:59 +03:00
fb9ffdc753 MXS-2015: Improve CDC connector error messages
The error messages now display the data received so far. This will help
resolve at which point the streaming process was when an error occurs.
2018-08-20 08:06:59 +03:00
d6ed10975e MXS-2015: Add missing newlines
The newlines were missing from a few of the avrorouter responses.
2018-08-20 08:06:59 +03:00
1c733bf450 MXS-2015: Always check for error responses
As a JSON object can never start with the ERR prefix, it is safe to check
it for all requests. Also fixed the missing newline in the avrorouter
error message.
2018-08-20 08:06:59 +03:00
af70dc3973 Fix build failures
Fixed build failures caused by merges and rebases.
2018-08-17 18:23:04 +03:00
667e9df97c Merge branch '2.2' into develop 2018-08-17 18:10:44 +03:00
208949f1cb Synchronize the worker thread with the starting thread
This guarantees that the caller of the start function will know whether
the worker is running by looking at its state.

This will prevent multiple successive stop calls to a worker which
happened when the monitors were altered via the REST API.
2018-08-17 18:09:51 +03:00
9510a3ae1a Use normal asserts in log.cc
The logger can't use the asserts that log messages as it introduces a
cyclical dependency on the logger itself.
2018-08-17 18:09:51 +03:00
0fbd789572 MXS-2019: Fix atexit handlers
The code now registers all functions once instead of one function multiple
times.
2018-08-17 17:35:41 +03:00
9b199cfb50 Remove duplicate CMakeLists.txt entry
maxutils/maxbase/src/test/CMakeLists.txt
2018-08-17 16:21:58 +03:00
b82822a4b0 MXS-2017 Move maxscale::Semaphore to maxbase::Semaphore 2018-08-17 15:57:44 +03:00
d8255d0cac MXS-2017 Move maxscale::Semaphore to maxbase::Semaphore 2018-08-17 15:53:54 +03:00
25c81b118d Rename conflicting test 2018-08-17 15:02:03 +03:00
81853d8d6b Fix binlogrouter unit test
The test called mxs_log_finish multiple times.
2018-08-17 14:29:28 +03:00
f09afa2967 Combine regression test suite and main CMake projects
Combining the projects makes it easier to use common components. This
fixes the build failure of maxutils due to missing jansson definitions.
2018-08-17 14:29:28 +03:00
c7a6d75ab9 MXS-2014 Address review issues 2018-08-17 10:59:37 +03:00
cf0aeed516 MXS-2014 Rename log_manager.h to log.h
There's nothing resembling a manager anymore.
2018-08-17 10:59:37 +03:00
894d4eb034 MXS-2014 Explicitly set the MaxScale log identification 2018-08-17 10:59:37 +03:00
15bf481120 MXS-2014 Allow the header and footer to be adjusted 2018-08-17 10:59:37 +03:00
4388b8517e MXS-2014 Use standard assert in Logger 2018-08-17 10:59:37 +03:00
cfdfff46ae MXS-2014 Add skeleton test for mxb::Log 2018-08-17 10:59:37 +03:00
12e8f28907 MXS-2014 Add mxb::Log class for convenience
In tests, the log can now be setup as

    int main()
    {
        mxb::Log log;
        ...
    }

That will initialize the log so that it logs to a file called
<program-name>.log in the current directory and finalize it
when the program exits.
2018-08-17 10:59:37 +03:00
be986d366a MXS-2014 Handle default OOM message properly 2018-08-17 10:59:37 +03:00
57706e7758 Hide the MonitorInstance m_state field
The field had the same purpose as MXS_MONITOR->state. Now the field
is only used for checking if the MonitorInstance thread is running.
2018-08-17 09:47:32 +03:00
fe5df6d379 Remove duplicate monitor state definitions
The state is still stored in two different variables. Also, removed the
ALLOC and FREED states.
2018-08-17 09:47:32 +03:00
876cf7c86f MXS-2014 Temporarily fix broken token pasting 2018-08-16 11:24:01 +03:00
19684deb69 MXS-2014 Init and finish properly
If any part of initalization fails, no resources are held.
At finalization, release all resources.

Also re-implement recent changes made to log_manager.cc that
did not automatically move over to log.cc.
2018-08-16 11:09:30 +03:00
a586aa13c4 MXS-2014 Add proper OOM support
Not that I think it ever will be needed...
2018-08-16 09:59:43 +03:00
85b68c439a MXS-2014 Still more cleanup of maxbase/log.h 2018-08-16 09:59:43 +03:00
9a8bb95be6 MXS-2014 Rename mxs_log_priority_is_enabled
- Renamed to mxs_log_is_priority_enabled
- That function instead of the macro is now consistently used
2018-08-16 09:59:43 +03:00
8ae2997c4e MXS-2014 Remove separate log_write() function 2018-08-16 09:59:43 +03:00
5b46d815e4 MXS-2014 Move message status checking into MessageRegistry 2018-08-16 09:59:43 +03:00
79b292dc39 MXS-2014 Additional cleanup of log.cc 2018-08-16 09:59:43 +03:00
5b70c7605c MXS-2014 Some cleanup of log.cc
Unused stuff removed and unit variables collected into this_unit
structure.
2018-08-16 09:59:43 +03:00
0c479b5d13 MXS-2014 Enable asserts in log.cc 2018-08-16 09:59:43 +03:00
6b6bbceb6e MXS-2014 Add maxbase/assert.h
Basically a copy of maxscale/debug.h, but with some name changes.

- ss_dassert      -> mxb_assert
- ss_info_dassert -> mxb_assert_message
- ss_debug        -> MXB_AT_DEBUG
2018-08-16 09:59:43 +03:00
952ee0c15f MXS-2014 Implement MaxScale log manager using maxbase/log.h 2018-08-16 09:59:43 +03:00
52e6e10e28 MXS-2014 Remove duplicate function
Two functions that essentially did the same thing, but had
slightly different name.
2018-08-16 09:58:00 +03:00
b4912a942f MXS-2014 Add missing MXB_[BEGIN|END]_DECLS 2018-08-16 09:58:00 +03:00