Commit Graph

11797 Commits

Author SHA1 Message Date
61bb172033 Cleanup failover/switchover
Replication settings warnings are printed once more. Changed some
parameter names to be more consistent within the monitor.
2018-08-23 10:28:47 +03:00
f93578c089 Remove debug.h include in LuaFilter 2018-08-23 10:25:01 +03:00
9799cfdb2b MXS-1735: Clarify differences between MaxScale and server
The server allows both unencrypted and encrypted connections on the same
port. MaxScale only allows either encrypted or unencrypted
connections. The differences as well as the reasoning for this need to be
documented.
2018-08-23 09:32:20 +03:00
75c298f63c MXS-2011 Make listener_set_ssl_version() const correct 2018-08-23 09:24:46 +03:00
8e7b012852 Don't call some of atexit functions twice
Registering of atexit functions was fixed so these functions don't need
to be called here anymore.
2018-08-22 22:51:32 +03:00
69722a32ca Fix crash caused by wildcards in NamedServeFilter source parameter
Use the formated IP address instead of the one with wildcard symbols.
2018-08-22 22:46:46 +03:00
7e3f5a03b6 Add a default value for BUILD_SYSTEM_TESTS
Adding a default value makes it visible in the CMake configuration GUI.
2018-08-22 16:43:17 +03:00
5485f83e75 MXS-1929: Always store the module name parameter
Services, monitors and filters all use the parameters for object
serialization. This means that when the object is created, the module
parameter must be in the parameter list.
2018-08-22 16:43:17 +03:00
276ff70506 MXS-1929: Prevent alterations to filters and servers
These parameters must not be altered at runtime via the `alter service` or
`alter monitor` commands.
2018-08-22 16:43:17 +03:00
73401837fd Skip interactive mode in tests
The automated tests aren't currently suited for testing it.
2018-08-22 16:43:17 +03:00
706f7ae86d Add MaxCtrl interactive mode to release notes
Mentioned the new behavior in the release notes.
2018-08-22 16:40:36 +03:00
fc7436c52a Add interactive mode to MaxCtrl
If no command is given, MaxCtrl is started in an interactive mode.
2018-08-22 16:40:36 +03:00
4480995089 MXS-1996: Remove misleading errors
The errors are expected if the file is empty.
2018-08-22 14:23:25 +03:00
9663c52f50 MXS-2015: Remove buffer iterator
The iterator to the buffer isn't really needed as the beginning of the
buffer can be used instead. This should make the code more robust. Changed
the internal buffer from a vector to a deque as the latter is more
appropriate for insertion on one end and consumption on the other.
2018-08-22 14:23:25 +03:00
f2dfd39f79 Clean up JSON diagnostics
Now prints all slave connections.
2018-08-22 12:23:28 +03:00
916b72a733 Clean up loops
Changed many of the iterator loops to range loops.
2018-08-22 12:22:45 +03:00
3777da96bd Miscellaneous cleanup
Removes needless status assignments and unused code. Moves and modifies some comments.
2018-08-22 12:11:33 +03:00
ab9a9f92cb MXS-2020 Remove maxscale/debug.h
- Removed from all files.
- maxbase/assert.h included where necessary.
2018-08-22 11:35:35 +03:00
3f53eddbde MXS-2020 Replace ss[_info]_dassert with mxb_assert[_message] 2018-08-22 11:34:59 +03:00
b1e405442f MXS-2020 Replace ss_debug with MXB_AT_DEBUG 2018-08-22 11:34:06 +03:00
84876b881b MXS-2020 Define ss_dassert etc. in terms of mxb_assert 2018-08-22 11:34:06 +03:00
88c3cd567d Remove HASHTABLE
Not used anyware, should have been removed ages ago.
2018-08-22 10:48:12 +03:00
e2ba7151b7 MXS-2008 Enforce right initialization of maxbase
Now maxbase can only be initialized via maxbase::init().
2018-08-21 14:35:51 +03:00
24ab3c099c Move top of the file "#pragma once" to after the following comment (swap them). If the comment is a BPL update it to the latest one 2018-08-21 13:13:15 +03:00
03cefcc4ac MXS-2012 Write replication lag to SERVER
Allows routers to read the value.
2018-08-21 11:51:10 +03:00
44a57dbefd Master can be a slave
This is possible if read_only is turned ON on the master and there is
no alternative master to swap to.
2018-08-21 11:51:10 +03:00
1c508cd413 MXS-2012 Read and print Seconds_Behind_Master
Replaces the old replication lag detection.
2018-08-21 11:51:10 +03:00
0d762b2019 MXS-2012 Remove old replication lag detection
The method was quite disruptive as it continuosly wrote to the database.
Also removed the MaxScale ID global, as it wasn't used for anything else.
2018-08-21 11:51:10 +03:00
3576780f78 MXS-2008 Update gateway and tests to initialize maxbase
Update gateway and tests to initialize maxbase using

  maxbase::init();

instead of initializing individual components.
2018-08-21 10:02:39 +03:00
e852dcacdd MXS-2008 Provide single entrypoint for initializing maxbase
Everything of maxbase can now be initialized by a call to

    maxbase_init();

(from a C-program) or

    maxbase::init();

from a C++-program and finalized with calls to either
maxbase_finish() or maxbase::finish(). Creating an instance
maxbase::MaxBase will take care of both operations.
2018-08-21 10:02:39 +03:00
88f1795412 MXS-2008 Move Worker and MessageQueue to maxbase 2018-08-21 10:02:39 +03:00
02ed338afa Remove mxs::Closer<json_t*>
As std::unique_ptr can now be used with a json_t, there's no need for the
closer.
2018-08-20 13:57:00 +03:00
0a0623003e MXS-1929: Factor out parameter validation
The parameter validation for all module types follows roughly the same
path: first check whether it's a known parameter and then whether the
value is valid. This can be moved into common functions that removes
duplicated code.
2018-08-20 13:57:00 +03:00
20994351ef MXS-1929: Fix SSL JSON detection
The SSL initialization should only be attempted if `ssl_key`, `ssl_cert`
or `ssl_ca_cert` is defined. In addition to this, the SSL parameters
requirements for servers and listeners are different: servers require only
`ssl_ca_cert` but listeners require all three.
2018-08-20 13:57:00 +03:00
eddae78b42 Remove repurposing of servers
This was not very safe or correct. For example statistics and parameters
were reused by a new server.
2018-08-20 13:57:00 +03:00
6a06654ee9 Serialize servers from parameters
The config and JSON serialization of servers is now from the
parameters. As the server's use a different parameter type, a temporary
adapter was required. Eventually, a lock-free and globally safe way to
"disable" parameters is needed.
2018-08-20 13:56:59 +03:00
e5c2b1a8c4 Create JSON serialization from object parameters
The services, monitors and filters now construct the JSON format
parameters from the configuration parameters. This reduces the need for
the amount of explicit operations and makes adding new parameters easier.
2018-08-20 13:56:59 +03:00
a9ff2a7056 MXS-1929: Serialize objects using parameters
The main "non-static" objects are now serialized using their
parameters. This makes it possible to use common code for most modules.
2018-08-20 13:56:59 +03:00
e2ace578d2 Validate parameters before storing them
The runtime modification of servers, services and monitors now validates
the parameters before starting the update process. This guarantees that
the set of parameters is valid before it is processed.

After the validation, the parameters are now also stored in the list of
configuration parameters. This will simplify the serialization process by
removing the need to explicitly serialize all common object parameters.
2018-08-20 13:56:59 +03:00
3c20b47a8d Change parameters in dump_param
Putting the file descriptor first keeps it in line with dprintf.

Making the parameter set an initializer list allows matching against
multiple sets of parameters in one function call. This will compact the
parameter serialization by using the same code for the common service
parameters and the module parameters.
2018-08-20 13:56:59 +03:00
355768c564 Add overloads to dump_stacktrace
Using a function while debugging helps to see where various functions are
called from.
2018-08-20 13:56:59 +03:00
fe7a73e5c3 Register atexit functions in the correct place
The atexit functions should be registered after there is a need for
them. This fixes the problem where cleanup functions were called before
the initialization for them was done. Also removed the header and footer
printint to stdout.
2018-08-20 13:56:59 +03:00
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