Commit Graph

13401 Commits

Author SHA1 Message Date
18cd890474 Fix binlogrouter slave heartbeat task addition
The task was added multiple times when only one task is needed.
2019-03-28 13:21:24 +02:00
f6219d1a80 Fix persistent connection debug assertion
The assertion was done before the DCB was assigned.
2019-03-28 13:21:24 +02:00
abd6e0924f Always load module defaults for monitors
The creation of a monitor from JSON relied on the non-JSON version for the
addition of default parameters but it proceeded to check the validity of
the parameters before it. Whenever parameters are checked, the default
parameters should be present.
2019-03-28 13:21:24 +02:00
548223ec9d Fix mxs2273_being_drained
The test didn't expect the Drained state. Also expanded the test to check
that the Draining state is not present when there are no connections.
2019-03-28 13:21:24 +02:00
858327acf7 Rename Being Drained to Draining
With this, the words are unique and can be searched for more easily. This
does not fix the test failure of mxs2273_being_drained.
2019-03-28 13:21:24 +02:00
02bdc5ef4d Fix object names in test configurations
Some of the test configurations relied on the name conversion that is now
removed.
2019-03-28 13:21:24 +02:00
3a8accee8f Fix mxs2326_hint_clone configuration
Whitespace in object names is not allowed anymore.
2019-03-28 13:21:24 +02:00
c3f3200d2c Fix removal of last server from monitor
If the last server was removed, the parameter would be rejected due to it
being empty. To remove the parameter, the
MonitorManager::reconfigure_monitor should be used. Also fixed the
unnecessary serialization after a failure to remove server from a monitor
and the fact that some errors were logged instead of written to the caller
of the command.
2019-03-28 13:21:23 +02:00
5ee9b74770 Fix readwritesplit server selection
If a server with zero weight was chosen as the only candidate, it was
possible that the starting minimum value was smaller than the server
score. This would mean that a candidate wouldn't be chosen if the score
was too high. To preven this, the values are capped to a value smaller
than the initial minimum score.
2019-03-28 13:21:23 +02:00
906f0ed3cd Add RAII class for stopping monitors
This way the state is encapsulated in the object and the required changes
are done in one place. This makes the code reusable across all functions
making it easier to implement better monitor alteration code.
2019-03-28 13:21:23 +02:00
ac0a3d1d47 Extend string helper functions
Moved mxs::strtok into mxb namespace and added mxb::join for joining
objects into strings.
2019-03-28 13:21:23 +02:00
c4b82b7d83 MXS-2359 Route statements with database but no table dependence
Queries such as SHOW TABLES FROM db1 are now routed to the backend with db1.
This gives the correct result as long as db1 is not sharded to multiple
backends.
2019-03-27 13:46:36 +02:00
ee88180c54 MXS-2409 Check that prepared statement exists
If the PREPARE is malformed, the extracted statement is null.
2019-03-27 13:46:36 +02:00
d46778d5d9 Formatting change.
Two changes in uncrustify. 1. do not align member initializers.
2. Do not split enums to multiple lines, force commas to be trailing.
Intendation is aligned as before.

const SOME_THINGS config_thing_params[] =
{
    {A,    B,  {C  ,D}};
    {E,
    F,
    {G,H}
    }
}
=>
const SOME_THINGS config_thing_params[] =
{
    {A, B, {C, D}};
    {E,
     F,
     {G, H}}
}

static const MXS_ENUM_VALUE ssl_values[] =
{
    {"required", 1              },
    {"true",     1              },
    {"yes",      1              },
    {"on",       1              },
    {"1",        1              },
    {"disabled", 0              },
    {"false",    0              },
    {"no",       0              },
    {"off",      0              },
    {"0",        0              }
}
=>
static const MXS_ENUM_VALUE ssl_values[] =
{
    {"required", 1},
    {"true", 1},
    {"yes", 1},
    {"on", 1},
    {"1", 1},
    {"disabled", 0},
    {"false", 0},
    {"no", 0},
    {"off", 0},
    {"0", 0}
}

enum E1 {A, B  ,  C};
=>
enum E1 {A, B, C};

enum E
{
    A, B
    ,Z
};
=>
enum E
{
    A, B,
    Z
};
2019-03-27 13:31:59 +02:00
d40e29d5f6 A little houskeeping.
Increasing counter sizes from int to long for averages.
Rename random functions to end with _co instead of _exclusive to
indicate range [close, open[, and to allow future suffixes oc, cc and oo.
2019-03-27 13:15:14 +02:00
a78f0fbe25 Merge branch '2.2' into 2.3 2019-03-27 12:16:54 +02:00
04f70879d2 MXS-2410: Uniquely identify DCBs
The address alone doesn't guarantee validity of a DCB.
2019-03-27 11:58:31 +02:00
c6ce4c2234 MXS-2359 Update schemarouter documentation
Moved limitations to the router documentation. Documented which queries get
exceptional handling.
2019-03-27 10:30:29 +02:00
c6272594d6 MXS-2359 Remove special handling for SHOW TABLES
The code only handled the basic version of the command, returning incorrect
results if modifiers were used. The code is now removed, causing the command
to be routed to the backend of the current database. This will give correct
results as long as that backend contains all the tables of the database e.g.
no table sharding.
2019-03-27 10:30:29 +02:00
3a32612096 MXS-2403 Extend test 2019-03-27 09:38:29 +02:00
03121c63d4 Add monitor reconfiguration helper
The MonitorManager function reconfigured a monitor and rolls back to the
old configuration if the new one doesn't work.
2019-03-26 17:30:38 +02:00
22004702bc Don't use CONFIG_CONTEXT in config_runtime.cc
The only thing that's needed is MXS_CONFIG_PARAMETER.
2019-03-26 15:53:20 +02:00
156abe81ee Add type and module to default parameters
When default parameters are loaded, the type and module name are
added. This helps object serialization and allows all the code to expect
that all the parameters needed to create an object are always present.
2019-03-26 15:53:20 +02:00
b180c346d9 Make filter parameters a part of the definition
The filter parameters are now a part of the filter definition.
2019-03-26 13:44:04 +02:00
fd39291542 Don't indent extern "C" blocks 2019-03-26 13:44:04 +02:00
f8bc6b18fc Only add tasks once in binlogrouter
Adding the same task twice isn't allowed. The API of the housekeeper tasks
might have to be changed in a way that makes it possible for the caller to
know whether a task has been added.
2019-03-26 13:44:04 +02:00
0915487329 Pass std::string to add/remove task
By passing strings instead of const char pointers to the task control
functions, we can safely make copies of them knowing that the contents
won't disappear.
2019-03-26 13:44:04 +02:00
f0756cd708 Queue addition of housekeeper tasks
This fixes the hang on startup when binlogrouter calls hktask_add.
2019-03-25 19:21:12 +02:00
1e4c5f5d2f Remove housekeeper.cc
It is no longer used.
2019-03-25 19:21:12 +02:00
2cbfe4fb8a Stop maxscale if it won't be restarted
This makes sure no MaxScales are running when the test is started.
2019-03-25 19:21:12 +02:00
e88b7f56f9 Match against default database of queries
If a query doesn't define a table, the default database wouldn't get
checked. To prevent this, it must be explicitly checked.
2019-03-25 18:49:25 +02:00
74c888316e Fix csmon version check
The version check still assumed that 1.1.7 has the required functionality.
2019-03-25 18:48:26 +02:00
45ba520057 Update csmon documentation
The required functionality for automatic "master" detection is in 1.2.
2019-03-25 18:48:26 +02:00
fe359593ba MXS-2407 Report database for SHOW TABLES FROM db
The database used in 'SHOW TABLES FROM db' is now available via
qc_get_database_names().
2019-03-25 17:02:36 +02:00
8b4961261f MXS-2403 Update documentation 2019-03-25 15:26:17 +02:00
3c7e64181b MXS-2403 Check only what is necessary
The amount of checking is minimized and what can be checked in one
go, is checked in one go.
2019-03-25 15:26:17 +02:00
f9f9599e74 MXS-2403 Reject if masked filed is used in subquery
There's some overlapping work being done now. To be cleanup up
in a subsequent commit.
2019-03-25 15:26:17 +02:00
8b329f7f33 MXS-2403 Add 'check_subqueries' parameter
Only documentation and parameter handling.
2019-03-25 15:26:17 +02:00
3870fac600 MXS-2402 MXS-2396 '*' should be blocked only if there are rules
If there are no rules for the current user, then '*' should be
allowed in UNIONS and when defining variables.
2019-03-25 15:24:35 +02:00
25f8931384 MXS-2402 Reject if masked field is referred to in UNION select
If the second or subsequent select of a UNION statement refers to
a field to be masked, then the statement must be rejected.
2019-03-25 15:24:35 +02:00
ca8350ae35 MXS-2402 Document and handle 'check_unions' parameter
Only parameter handling, no actual functionality.
2019-03-25 15:24:35 +02:00
f37340e9fd MXS-2397 Provide context information for fields
The query classifier now returns contextual information for a fields;
does it appear in the (right hand side) of a UNION or in a SUBQUERY.
2019-03-25 15:24:35 +02:00
bf5f80b13b Fix ClustrixMonitor
The cluster check can only be made after the monitor has been
started. If done when monitor is configured it will at startup
be done when services are not yet available and hence they will
not be populated with the dynamically discovered servers.
2019-03-25 13:56:39 +02:00
382ddf3ea1 Update bug673 to expect new behavior
Since whitespace in object names is now disallowed, the test must be
adjusted accordingly.
2019-03-25 12:37:11 +02:00
c70dc23211 Fix processing of path parameters
Instead of the first character of the string being compared to the value
the whole string was compared.
2019-03-25 12:37:11 +02:00
4880edd373 Fix removal of servers from monitors
The last server wasn't removed as the set of relationships was empty. In
addition to this, changes to relationships via the relations endpoint
wasn't reflected by the monitor parameters.
2019-03-25 12:37:11 +02:00
9bb5e12413 Fix monitor creation and alteration
If a monitor was created at runtime, it was missing some parameters that
were assumed to be always present. In addition to that, the parameters
weren't validated against the list of common and module parameters.

Since the monitors always reconstruct the server list, the new servers can
be stored as a parameter. To make this possible, the
server_relationship_to_parameter helper function is needed.

This commit fixes the MaxCtrl test suite failures but does not fix the
failures in the REST API test suite.
2019-03-25 12:37:11 +02:00
2f634264dc Merge branch '2.3' into develop 2019-03-22 13:39:52 +02:00
4c6306e363 Merge commit '5cdba97ec7ee7f1ef74249b952774adf1b111464' into develop 2019-03-22 13:25:58 +02:00
75c6ef2dc8 Fix mxs_json_error usage
The function takes printf style arguments which means the format string
must be a string constant.
2019-03-22 12:52:56 +02:00