11300 Commits

Author SHA1 Message Date
Markus Mäkelä
50c20e79ee
MXS-1929: Reject promise on invalid input
If a value that is not of key-value format was given to the create
commands, the code previously threw an exception. This causes tests to
misbehave so changing it to a rejected promise is more appropriate.
2018-08-09 12:56:52 +03:00
Markus Mäkelä
db09996bb8
MXS-1929: Prevent destruction of services with filters
If a service has filters, they must first be removed before the service
can be destroyed. This is not a functional requirement but it keeps the
behavior consistent so that the relationships of a service must be empty
before it is destroyed.
2018-08-09 12:56:52 +03:00
Markus Mäkelä
ccdf1c5679
Improve MaxCtrl test coverage
Added tests that cover areas that weren't tested before.
2018-08-09 12:56:51 +03:00
Markus Mäkelä
1447ac2eb9
Fix MaxCtrl cluster tests
The configuration used an invalid parameter name which caused the two
MaxScales to use the same directory for persisted configurations.

The test also tried to sync with the wrong server causing the same
listener to be created twice on the same port but on different MaxScales.

Cleaned up the startup and shutdown scripts to always start from a clean
state.
2018-08-09 12:56:51 +03:00
Markus Mäkelä
b69fc4d32c
Fix startup of MaxScales in NPM tests
The output was overwritten for each new test.
2018-08-09 12:56:50 +03:00
Markus Mäkelä
38219556b6
Fix crash on failure to listen on port
If a listener was created at runtime and at some point it fails (e.g. the
port is already taken), the listener would be removed from the service. In
2.2, the removal of the listeners simply marked the listener as
inactive. In 2.3, the functions were combined so that the listener is
marked as inactive and removed from the workers. The fact that the
listener had a NULL DCB at that point caused the crash.

The correct thing to do is to not remove the listener from the service and
to mark the listener as inactive in the close_port helper function. The
listener will be freed once the service is destroyed.
2018-08-09 12:56:50 +03:00
Markus Mäkelä
679ab6a0e9
Remove printing to console in test
The test case, for whatever reason, printed data to the console.
2018-08-09 12:56:49 +03:00
Markus Mäkelä
207a8609dc
Use docker directly in NPM test runner
The checking of the container status should use docker directly.
2018-08-09 12:56:49 +03:00
Markus Mäkelä
6e481a0f95
Fix REST API tests
The tests expected results that weren't correct.
2018-08-09 12:56:49 +03:00
Markus Mäkelä
37d9c09c5f
Make NPM tests faster
The test now builds with multiple jobs.
2018-08-09 12:56:49 +03:00
Markus Mäkelä
81d1a6122c
MXS-1929: Test atomic swap of filters
When the filters of a service are modified, each session to that service
should either see the old filters or the new filters i.e. the operation
must be atomic.
2018-08-09 12:56:49 +03:00
Markus Mäkelä
b4a748ab8f
MXS-1929: Test creating filters under load
Extended the test to repeatedly create and destroy filters under load.
2018-08-09 12:56:48 +03:00
Markus Mäkelä
f560172665
MXS-1929: Fix creation of filters that have no parameters
If the filter does not declare defaults and no parameters are defined, the
list of parameters would be NULL. This was interpreted as an error and the
filter creation failed.
2018-08-09 12:56:48 +03:00
Markus Mäkelä
f3a64f0b56
MXS-1929: Rename alter service filters
The command naming caused problems when other parts of the service were
being altered. The parser doesn't seem to handle the case of overlapping
commands that well.

Updated test cases with new code and adjusted syntax accordingly.
2018-08-09 12:54:16 +03:00
Markus Mäkelä
c56ef3cc27
Stop processing configuration after the first failure
If the configuration processing encounters an error at the object
construction stage, it needs to stop immediately. If another object
depends on the object that failed, it would also fail but in a very
confusing manner. Mainly this manifests itself as a missing reference to
the object which would cause misleading errors to be logged.
2018-08-09 12:54:14 +03:00
Markus Mäkelä
6e79e34dd7
Do not destroy services when setting filters fails
If the setting of filters for a service fails at startup, it need not be
destroyed as it will be destroyed when MaxScale stops.
2018-08-09 12:54:13 +03:00
Markus Mäkelä
cce0aaa7e1
MXS-1929: Extend runtime filter test
Added testing of how MaxScale displays filters that are destroyed but
still in use.
2018-08-09 12:54:12 +03:00
Markus Mäkelä
30fe7d2931
MXS-1929: Add basic filter creation/destruction test
The test creates and destroys a regexfilter at runtime and checks that the
filter remains in use for as long as the connection is open.
2018-08-09 12:54:11 +03:00
Markus Mäkelä
25bc385db2
MXS-1929: Check presence of filter parameters
The parameters were made optional as not all filters require parameters.
2018-08-09 12:54:10 +03:00
Markus Mäkelä
785507b002
Check return value of nodejs --version
FindNodeJS.cmake once failed due to an error executing the program. To see
why it failed, the error output of the command should be printed.
2018-08-09 12:54:06 +03:00
Johan Wikman
2539183be2 MXS-2000 Add query_classifier_cache_size to maxscale resource 2018-08-09 08:37:44 +03:00
Johan Wikman
cf4521503f MXS-2000 Add 'show thread[s]' to maxctrl
Show thread[s] shows detailed information about threads.
2018-08-09 08:35:57 +03:00
Johan Wikman
515cc3231c MXS-2000 Introduce 'maxctrl list threads'
Basically the same as the existing 'show threads', with a bit
shorter names. The current 'show threads' will be changed to
resemble the other 'show' commands, that is, the output is a
list of detailed information of each object.
2018-08-09 08:35:57 +03:00
Johan Wikman
055b93ba1a MXS-1962 Create test for implicit masking firewall
By default, if some column should be masked, then if a function
is used in conjunction with that column, the statement should be
rejected.
2018-08-09 08:35:03 +03:00
Johan Wikman
5c6db6dc06 Merge branch '2.2' into develop 2018-08-08 11:20:15 +03:00
Johan Wikman
f4c564481c Update version of 2.2 2018-08-08 11:19:13 +03:00
Johan Wikman
21cb52d0e7 Merge branch '2.2' into develop 2018-08-08 11:02:20 +03:00
Johan Wikman
ebbd3b8312 Merge branch '2.2.13' into 2.2 2018-08-08 11:02:06 +03:00
Johan Wikman
8792a4a3d1 Update release date 2018-08-08 10:58:21 +03:00
Johan Wikman
0b3e9cce75 Fix rebase problems 2018-08-08 09:21:59 +03:00
Johan Wikman
c06b36a6ee MXS-1992 Remove place-holder for specific error handling 2018-08-08 09:17:58 +03:00
Johan Wikman
326bb88f70 MXS-1992 Expose config.cc:runtime_error as config_runtime_error 2018-08-08 09:17:58 +03:00
Johan Wikman
fbb79adc52 MXS-1992 Address review issues 2018-08-08 09:17:15 +03:00
Johan Wikman
1b521b16a9 MXS-1992 Move QC json "parsing" to query_classifier.cc 2018-08-08 09:17:15 +03:00
Johan Wikman
2188090742 MXS-1992 Expose type checking functions of config_runtime.cc
The functions

bool runtime_is_string_or_null(json_t* json, const char* path);
bool runtime_is_bool_or_null(json_t* json, const char* path);
bool runtime_is_count_or_null(json_t* json, const char* path);

can now be called from anywhere inside MaxScale.
2018-08-08 09:17:15 +03:00
Johan Wikman
185758ef06 MXS-1992 Allow changing the QC cache size 2018-08-08 09:17:15 +03:00
Johan Wikman
dae6cf0648 MXS-1992 Allow the setting/getting of cache size at runtime 2018-08-08 09:16:19 +03:00
Johan Wikman
bb77ae7b95 MXS-1992 Rename internal/query_classifier.h to .hh 2018-08-08 09:16:19 +03:00
Johan Wikman
90569e3a28 MXS-1992 Expose qc stats in threads info
In principle it would be better if the qc information were
obtained via a specific query_classifier resource. However,
there are multiple problems with that (e.g. the qc has no way
of safely accessing information of another thread) and hence
the worker specific qc cache statistics is reported as part of
the worker statistics.
2018-08-08 09:16:19 +03:00
Johan Wikman
fbd3b08c1e MXS-1992 Make preparations for REST-API 2018-08-08 09:16:19 +03:00
Markus Mäkelä
1a7fa349fd
MXS-1929: Use correct variable
The service capabilities were not set for filters as the name overlapped
with a local variable. The variable name was fixed but the actual use of
it was not.
2018-08-07 22:30:19 +03:00
Markus Mäkelä
93946375ca
Ignore passwd in persisted configurations
If a passwd parameter is defined in a persisted configuration, it will be
ignored. This will make upgrades from 2.2 to 2.3 possible with persisted
configurations.
2018-08-07 22:30:18 +03:00
Markus Mäkelä
b68d9920cf
Reopen connection before validating data
The setup_binlog test seems to fail due to a broken backend conection.
2018-08-07 22:30:18 +03:00
Markus Mäkelä
bb1efd1b34
Merge branch '2.2' into develop 2018-08-07 22:20:27 +03:00
Markus Mäkelä
7394f03cd9
Exit with failure if coredump is found in destructor
If the test would otherwise succeed but a coredump is found when the logs
are copied in the destructor, the test would pass. To prevent this, the
destructor should always exit with a non-zero status when it detects an
error.
2018-08-07 22:14:33 +03:00
Markus Mäkelä
055043b5b8
Fail faster in NPM tests
The test script now stops if the configuration or build steps fail.
2018-08-07 22:14:33 +03:00
Markus Mäkelä
446116a8bb
MXS-1999: Fix removal of undefined relationships
If a relationship isn't defined, it should not be removed. Only if a
relationship is change to a null relationship, should it be removed.

Also fixed the maxctrl test suite to verify that both it and the REST API
tests pass.
2018-08-07 22:14:33 +03:00
Markus Mäkelä
4fd4d6bb01
MXS-1999: Fix null relationship handling
The data of the relationship should be set to null to delete the
relationship. Conceptually it is different from setting it to an empty
relationship but in practice both lead to the same end result.

Updated tests to use correct relationships and added test cases for
detection of invalid relationships.
2018-08-07 22:14:32 +03:00
Markus Mäkelä
3754008e43
Add missing cdc_connector dependencies
Added the missing dependency on Jansson to the CDC connector.
2018-08-07 22:14:32 +03:00
Esa Korhonen
3f2838ab36 Avoid repeated logging when retrying automatic failover or switchover
Prevents repeated logging of similar error messages.
2018-08-07 16:36:48 +03:00