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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.