Commit Graph

11131 Commits

Author SHA1 Message Date
a50fce0c65 MXS-1929: Allow startup with no services
MaxScale can now be started with an empty configuration file and services
can be created at runtime. Filters cannot yet be created at runtime so
complete runtime creation of configurations is not yet possible.
2018-07-31 09:41:09 +03:00
106b1d46d5 Only perform causal reads on slaves
The causal read queries were performed also when the target server was the
master. The extra functionality of the causal reads is only needed on
slaves.

Adjusted the test case to require GTID replication.
2018-07-31 09:41:09 +03:00
d7a3980308 Read correct parameter for causal_reads
The configuration used the wrong parameter name. The test also did not
explicitly enable tracking of the last_gtid variable which caused it to
fail if it wasn't already on.
2018-07-31 09:41:09 +03:00
823efffb00 Read config as late as possible
By reading the configuration as late as possible, we allow the objects to
be created in an environment which is nearly identical to the environment
that is present at runtime.

This change makes it possible to execute worker tasks in the instance
creation functions of various modules. The avrorouter in particular
depended on being able to queue worker tasks on startup.
2018-07-31 09:41:08 +03:00
a553ddba6e MXS-1929: Split housekeeper initialization
The initialization and starting of the housekeeper is now done
separately. This allows housekeeper tasks to be created when the services
are being created while still preventing the execution of the task before
the startup is complete.
2018-07-31 09:41:08 +03:00
843b8d92eb Enable mxs1778_causal_reads with 10.3.8
The MariaDB 10.3.8 release fixes the use of last_gtid as a value for
session_track_system_variables. This means that the test can be enabled if
the backends are new enough.
2018-07-31 09:41:08 +03:00
560157081c MXS-1929: Persist the router parameter
The router parameter was not persisted for services.
2018-07-31 09:41:08 +03:00
f10eab4406 MXS-1929: Fix binlogrouter unit test failure
The test failed because router instances are now created when the service
is allocated. In addition to this, a debug assertion was hit when a
service was freed if the router instance creation failed.
2018-07-31 09:41:07 +03:00
146fe76c7a MXS-1929: Add create/destroy service MaxCtrl commands
Added commands for creating and destroying services. The create command
allows server and filter relationships to be defined but they are not yet
processed by MaxScale. This will be done once the use of filters is made
dynamic.
2018-07-31 09:41:07 +03:00
037cedf70e MXS-1929: Allow service creation at runtime
Services can now be created at runtime. The command to create services is
exposed in the REST API.
2018-07-31 09:41:07 +03:00
5a40064826 MXS-1929: Make services destroyable
Services can now be destroyed if they have no active listeners and they
are not linked to servers. When these conditions are met, the service will
be destroyed when the last session for the service is closed.

The closing of a service will close all listeners that were once assigned
to the service. This allows closing of the ports at runtime which
previously was done only on shutdown.

Exposed the command through the REST API but not through MaxAdmin as it is
deprecated.
2018-07-31 09:41:07 +03:00
18c1ec2678 MXS-1929: Make listeners inactive when destroyed
By using service_remove_listener the listener is marked as inactive when
it is destroyed.
2018-07-31 09:41:06 +03:00
23d944b82e MXS-1929: Close listener DCBs
When a service is freed, it will free all of its listeners causing their
respective DCBs to be closed. This requires that listeners can be removed
from the worker DCB list.
2018-07-31 09:41:06 +03:00
b93eaf6fb2 MXS-1929: Validate multiple JSON relationships
The runtime configuration JSON validation now allows multiple
relationships to be verified at one time. This makes it easier to validate
all objects using the same framework.
2018-07-31 09:41:06 +03:00
aeb94cbc9e MXS-1929: Remove listener from service and workers
When a listener is removed from a service, it should also be removed from
any workers it has been added to. This guarantees that if the opening of
the listener was successful, no requests will be accepted on it after the
removal of the listener.
2018-07-31 09:41:06 +03:00
4069072164 Do service client counts in the core
As all connections should be accepted via dcb_accept, it is the optimal
place to calculate how many open client connections per service there
are. The decrementation should be done when the session is closed instead
of when the call to dcb_close for the client DCB is done. This allows the
client count to be the absolute reference count that sessions have to a
service.

The current client count is a duplicate counter that should match the
n_current value in SERVICE_STATS. The former does differ from the latter
in that it does the incrementation when the client DCB is accepted instead
of when the session is created.
2018-07-31 09:41:06 +03:00
36822da172 MXS-1929: Create router instance in service_alloc
By creating the router instance as a part of the service allocation
process, we are guaranteed that either the creation of the service is
completely successful or it fails. This should make runtime creation of
services easier.
2018-07-31 09:41:05 +03:00
d8b539c85a MXS-1929: Add REST API filter test
Most parts of the test still fail due to the fact that they haven't been
implemented.
2018-07-31 09:41:05 +03:00
3de0847806 MXS-1929: Update REST API documentation for filters
Added the creation of filter via the POST method.
2018-07-31 09:41:05 +03:00
2c1f79c5d1 MXS-1929: Add runtime creation of filters
Filters can now be created at runtime. This is not yet a usable feature
since the filters can't be added to services at runtime.
2018-07-31 09:41:05 +03:00
d6c378187c Use a more intrusive waiting in setup_binlog
As we know that the test doesn't rely on absolute binlog positions, we can
force synchronization by creating a table on the master and waiting until
that table is replicated to all slaves.
2018-07-31 09:41:05 +03:00
3817960658 MXS-1113 Add basic test
Add test case for text and binary protocol prepared statements in
schemarouter.
2018-07-30 17:22:28 +03:00
11d57a264c MXS-1113 Add support for prepared statements in schemarouter
Add support for binary protocol prepared statements for schemarouter.
This implementation doesn't yet attempt to handle all the edge cases.

Prepared statements are routed to the server that contains the affected
tables, the internal id from the server is then mapped to the session
command id that is inceremented for each prepared statement. This unique
session command id is returned to the client because internal id given
by server might be same around different servers and this way it is
possible to keep track of them and route them to the right servers when
executed.
2018-07-29 14:55:53 +03:00
adbc3a6749 MXS-1113 Add support for prepared statements in schemarouter
Implement handling of the text protocol part of the prepared statements
in schemarouter.
2018-07-29 14:21:55 +03:00
bfe5bcd7a7 Merge branch '2.2' into develop 2018-07-27 19:46:13 +03:00
2f8ebf7ce0 Merge branch '2.2.12' into 2.2 2018-07-27 19:46:01 +03:00
90477f9081 Update release date 2018-07-27 19:45:28 +03:00
fc672dc56e Update release documentation
Removed old and meanlingless parts from emails, added symlink creation.
2018-07-27 19:32:47 +03:00
ab4ae282a4 Merge branch '2.2' into develop 2018-07-27 14:59:49 +03:00
5612896b80 regenerate repo.d only for current target 2018-07-27 14:58:29 +03:00
d59917673d do not generate repo.d in run_test 2018-07-27 14:58:29 +03:00
d6be2cb70d fix typo in upgrade_test 2018-07-27 14:58:29 +03:00
81507349f3 remove reference to repo.d from upgrade_test 2018-07-27 14:58:29 +03:00
ba680b674d do not call mdbci repo config in build.sh and upgrade_test.sh 2018-07-27 14:58:29 +03:00
cfa07c69ff Clean up switchover_check_current()
Now uses MariaDBServer.
2018-07-27 11:20:23 +03:00
18bfca0533 Define inline functions for status variables
The functions are used in MariaDB Monitor.
2018-07-27 11:20:23 +03:00
27e668a3cb Set test timeout to 900 seconds
Any test that takes longer than 15 minutes to run is too long and should
explicitly set a longer timeout.
2018-07-26 16:32:46 +03:00
6c59da77fb Merge branch '2.2' into develop 2018-07-26 11:27:09 +03:00
571d52f557 Typo fix in logthrottling_test 2018-07-26 10:59:53 +03:00
4dc1638f78 Silence the -Wunused-result warning
-Wunused-result warning in test_logthrottling.cc was causing error when
trying to build MaxScale from source. This warning can be silenced with by
putting the function triggering the warning in if-clause.
2018-07-26 10:59:53 +03:00
e64e4bc34f Use the word REST API in documentation
The HTTP admin interface was ambiguous.
2018-07-26 10:59:53 +03:00
3243f741a0 MXS-1961 Standalone master loses master status when an alternative master emerges
Fixes the bug by requiring that only running slaves are considered when choosing a master.
2018-07-26 10:37:30 +03:00
fbce38878b Turn server status macros to functions 2018-07-25 11:19:47 +03:00
e2a913013a Update release procedure documentation
The documentation contents and upgrading documents no longer has a link to
the release notes.
2018-07-25 00:11:57 +03:00
10115601ca Add 2.2.12 release notes
Added release notes for the 2.2.12 release.
2018-07-25 00:07:09 +03:00
b421e56d1c Move execute_worker_task to MonitorInstance
The function is rather general and may of use to other monitor modules.
2018-07-24 15:07:18 +03:00
4b7cd7a281 Dump queue contents on unexpectedly NULL buffer
When the query queue does not contain a complete packet
(i.e. modutil_get_next_MySQL_packet return NULL), an informative dump of
how many bytes and what is stored is logged.
2018-07-24 09:51:48 +03:00
ea5c5f3a07 Never return NULL from gwbuf_make_contiguous
By aborting the process if memory runs out when a buffer needs to be made
contiguous, we rule out other, more subtle, errors. Failing as soon as a
possible when memory allocation fails gives better error messages.
2018-07-24 09:51:47 +03:00
896c7deb03 Use gwbuf_make_contiguous only with non-NULL buffers
A NULL buffer should never be made contiguous as that points to a flaw in
program logic.
2018-07-24 09:51:47 +03:00
37f32464f2 Rewrite mxs564_big_dump
Streamlined the test to perform as much testing as fast as possible. The
gradual ramp up did not provide any concrete benefits compared to testing
everything at once.

Replaced structures with C++11 alternatives where possible and removed
unused, redundant or dead code.
2018-07-24 09:51:47 +03:00