8123 Commits

Author SHA1 Message Date
Markus Mäkelä
1514ede4e1 MXS-1300: Add logging commands
Added commands for altering logging parameters and for rotating logs.
2017-07-10 22:23:48 +03:00
Markus Mäkelä
78a95def7d MXS-1300: Add build script for MaxCtrl
The build uses the pkg library to package a Node.js app and all of its
dependenices.
2017-07-10 22:23:48 +03:00
Markus Mäkelä
ebfa631bae MXS-1330: Add alter command
Servers, monitors and services can now be altered with MaxCtrl.
2017-07-10 22:23:48 +03:00
Markus Mäkelä
46339d620a MXS-1220: Interpret no relationships as old relationships
When a PATCH request to a resource is made with no relationships defined,
it should be interpreted to be the same as the old relationships. Removal
of relationships can still be done by defining an empty relationships
object.
2017-07-10 22:23:48 +03:00
Markus Mäkelä
731d19ba70 MXS-1220: Add test for monitor alteration regression
Altering monitor parameters without defining the relationships was
interpreted as an attempt to remove all relationships. This test
reproduces the problem.
2017-07-10 22:23:48 +03:00
Markus Mäkelä
4913cf1ec7 MXS-1300: Add maxscale to show commands
The command shows general information about MaxScale.
2017-07-10 22:23:48 +03:00
Markus Mäkelä
f4dacff27c MXS-1300: Correct clear entry point documentation
Corrected the clear entry point documentation by changing the method from
POST to PUT. Fixed MaxCtrl to use the correct methods for set/clear.
2017-07-10 22:23:48 +03:00
Markus Mäkelä
252022534c MXS-1300: Add start/stop commands
Added start and stop commands for starting and stopping services and
monitors.
2017-07-10 22:23:48 +03:00
Markus Mäkelä
a0e7a97729 MXS-1300: Add create/destroy/list commands for users
Users can now be listed, created and destroyed via MaxCtrl.
2017-07-10 22:23:48 +03:00
Markus Mäkelä
b0f2d02787 MXS-1300: Add link/unlink command to MaxCtrl
The link/unlink commands are similar to the add/remove commands in
MaxAdmin but they link services and monitors to a list of servers instead
of linking servers to a list of either services or monitors. This can
reduce the number of required calls to alter the configuration while
making the process easier for MaxCtrl to do via the REST API.

Also fixed a false negative where a service alteration which results in a
no-op would be counted as an error.
2017-07-10 22:23:47 +03:00
Markus Mäkelä
7db1f4c768 MXS-1300: Add create/destroy commands
Servers, monitors and listeners can now be created and destroyed with
MaxCtrl.

Exported lodash as a part of the common.js module so that commands can use
it to construct objects. If there are enough common uses of this library,
some of the object construction could be moved to the common module.
2017-07-10 22:23:46 +03:00
Markus Mäkelä
35745ee925 MXS-1220: Add deletion of listeners
The listeners can now be deleted via the REST API. Documented the added
endpoint in the REST API documentation.
2017-07-10 22:23:46 +03:00
Markus Mäkelä
7e40c93cc4 MXS-1220: Add listener creation documentation
The documentation for creating listeners was not added.
2017-07-10 22:23:45 +03:00
Markus Mäkelä
e0076ca8a5 MXS-1220: Fix request methods for user creation
The creation of network users and enabling of UNIX accounts documented PUT
as the method for enabling them when the commands actually used POST.
2017-07-10 22:23:45 +03:00
Markus Mäkelä
bb5b83bf7b MXS-1300: Add enable/disable command
The enable/disable commands allow logging options and UNIX admin accounts
to be enabled and disabled.
2017-07-10 22:23:45 +03:00
Markus Mäkelä
cfa0fd9803 MXS-1300: Create more helper functions
The common error logging function prints and colors the output in an
uniform way. The updateValue function allows easy PATCH updates to a
single value of a resource.
2017-07-10 22:23:45 +03:00
Markus Mäkelä
c7b9b7ac4a MXS-1220: Unify resource member naming
All resoures now use the `state` member to describe their internal
state. This includes servers, services and monitors. This means that the
`status` keyword can be reserved for something else and it can be removed
until it is needed again.

Changed the module maturity field to `maturity` to better describe its
purpose.
2017-07-10 22:23:45 +03:00
Markus Mäkelä
a8bfdac49c MXS-1220: Use PUT to set/clear server
The correct method for set/clear endpoints is PUT, not POST, as the
resource always ends up in the desired state, regardless of its current
state.
2017-07-10 22:23:45 +03:00
Markus Mäkelä
30a40a090b MXS-1300: Make global option descriptions more brief
The option descriptions now fit on one line with their parameter types and
default values.
2017-07-10 22:23:44 +03:00
Markus Mäkelä
f62e899b79 MXS-1220: Add missing start/stop documentation for service resources
The service resource start and stop endpoints weren't documented.
2017-07-10 22:23:44 +03:00
Markus Mäkelä
6955be901f MXS-1300: Use single quotes in Node.js code
The Node.js code should use single quotes as it appears to be a prevalent
style choice for Node.js applications.
2017-07-10 22:23:44 +03:00
Markus Mäkelä
8fb1137ef0 MXS-1300: Add usage to all commands
Added usage instructions for all commands. If the generated usage is used
with the `pkg` packager, it will contain generated script names which are
confusing.
2017-07-10 22:23:44 +03:00
Markus Mäkelä
4cf17bc450 MXS-1300: Add set and clear commands
The manipulation of server status is now possible with the set and clear
commands.
2017-07-10 22:23:44 +03:00
Markus Mäkelä
38930e198d MXS-1300: Fix duplicated options
Moved the option declaration to the main source file. Added default
functions for all modules to catch unknown command invokations. Cleaned up
and exposed more ways to use the doRequest function.
2017-07-10 22:23:44 +03:00
Markus Mäkelä
63d2eee0e3 MXS-1220: Add endpoint for set/clear of server status
The server status can now be manipulated via the REST API. Added tests for
the state manipulation. Fixed minor issues in related code.
2017-07-10 22:23:44 +03:00
Markus Mäkelä
c189378389 MXS-1330: Pair header names with resource paths
The getCollection and getResource now use similar mechanisms to declare
the names and values for the tables.
2017-07-10 22:23:44 +03:00
Markus Mäkelä
1148ed9876 MXS-1300: Add initial implementation of MaxCtrl
This is the administrative client that uses the REST API to communicate
with MaxScale. It is written in Node.js as it can handle the JSON format
data returned by the REST API natively. Currently only list and show
functionality is implemented.
2017-07-10 22:23:43 +03:00
Markus Mäkelä
61241f9e07 Remove old feedback system
The feedback system wasn't used and was starting to cause problems on
Debian 9 where the libcurl required different version of OpenSSL than what
MaxScale was linked against.
2017-07-10 16:03:50 +03:00
MassimilianoPinto
33e1878fe1 MXS-1302: addition of CaptureRule class
Addition of CaptureRule class, derived from Rule class
2017-07-10 14:10:21 +02:00
MassimilianoPinto
f10cc156a5 MXS-1302: added tests for "obfuscate"
Tests updated
2017-07-10 13:47:29 +02:00
MassimilianoPinto
f3547d14a1 Masking filter: removed create_rule_from_elements() routines
Masking filter cleanup: create_rule_from_elements() removed.
2017-07-10 09:49:20 +02:00
MassimilianoPinto
e70852d10b Code cleanup in ReplaceRule::create_from()
Code cleanup in ReplaceRule::create_from()
2017-07-10 09:49:20 +02:00
Markus Mäkelä
deef6bb030 Extend text protocol PS test
The test now checks that text protocol prepared statements are load
balanced just like normal queries.
2017-07-08 08:15:42 +03:00
MassimilianoPinto
8b5c6f7286 Merge branch 'MXS-1302' into develop 2017-07-07 17:37:16 +02:00
MassimilianoPinto
9490af2fb1 MXS-1302: Addition of ObfuscateRule derived class and 'obfuscation' rule
New rule ‘obfuscate’ is being added:
{
"obfuscate": {
"column": “p_name”,
"database": "test",
"table": "masking"
}
},
"applies_to": [ ... ],
"exempted": [ ... ]
2017-07-07 17:31:37 +02:00
MassimilianoPinto
b26e2d8189 MXS-1302: masking filter value replacement is done by new ReplaceRule, derived form base class Rule
The value replacement is now done by new ReplaceRule, derived form base
class Rule
2017-07-07 15:02:59 +02:00
Markus Mäkelä
96b98845a2 Allow filters to be used with binlogrouter
Filters can now be used with the binlogrouter to modify the contents of
the binlog stream now that the correct function call is used.
2017-07-07 10:37:30 +03:00
Markus Mäkelä
54c6e0eb52 Increase verbosity and timeouts in bug662
The test restarts MaxScale while all backends are blocked. This will cause
MaxScale to wait until all connections to all servers time out which can
take a while.

Added a separate config for the test and lowered the timeouts. Also
inreased test timeouts.
2017-07-06 14:01:51 +03:00
Markus Mäkelä
61cfd92510 Stop replication before configuring binlogrouter
The replication needs to be stopped before the binlogrouter is started. If
the replication is stopped after this, it is possible that two servers
with the same value of server_id attempt to register as slaves which
causes the later of them to fail.
2017-07-06 13:54:59 +03:00
Markus Mäkelä
22d47aab52 Print the JSON in avro_alter
The test now prints the output in avro_alter. The replicate_from_master
function also stops maxscale before removing the files.
2017-07-06 13:31:38 +03:00
Markus Mäkelä
ef73f3e217 Merge branch '2.1' into develop 2017-07-06 11:25:36 +03:00
Markus Mäkelä
66048cf094 Add 2.1.5 release notes
Added release notes for 2.1.5.
2017-07-06 11:03:44 +03:00
Markus Mäkelä
9618e63b5f MXS-1310: Add deterministic conflict resolution
The schemarouter can now resolve database mapping conflicts in a
deterministic manner. This will fix the problem of central databases which
are replicated shards being assigned in a non-deterministic manner.
2017-07-05 19:19:49 +03:00
Markus Mäkelä
a23e81c438 Add test for MXS-1310
Added test that checks how the use of implicit databases is handled in
schemarouter.
2017-07-05 08:42:52 +03:00
Markus Mäkelä
0c33572a96 MXS-1310: Detect implicit database usage
When the current database is implicitly used in a query that also uses an
explicit database, it must be routed to the shard which has the current
database.

As cross-shard joins are not supported, the safest, and possibly the most
expected course of action to take, is to route it to the so-called default
shard. The default shard is the shard that contains the database that is
currently set as the active database with a COM_INIT_DB, a text protocol
USE <database> query or it was set at connection time.
2017-07-04 23:21:04 +03:00
Markus Mäkelä
c6b579619a MXS-1310: Route implicit table queries to the current shard
When a query that implicitly uses the current database is detected, it
will be routed to the shard which has the current database.
2017-07-04 23:04:27 +03:00
Markus Mäkelä
374c204a04 Only print text protocol statements in schemarouter
The schemarouter info level logging treated all queries as something that
contain SQL statements. This, for somewhat obvious reasons, cannot be
expected.
2017-07-04 22:26:24 +03:00
Markus Mäkelä
71bc67b694 Use unordered_map in schemarouter
The shard map doesn't have to be in order and an unordered map will do
just fine.
2017-07-04 13:01:04 +03:00
Markus Mäkelä
11d494ef33 Fix avro CREATE TABLE message
The string was assumed to be null-terminated when in reality it was not.
2017-07-04 12:40:22 +03:00
Markus Mäkelä
285086ba7c Fix ALTER TABLE regression in avrorouter
The avrorouter failed to detect ALTER TABLE statements which caused a
regression. Extended the alter table tests to parse the JSON for more
strict validation of test results.
2017-07-04 12:40:22 +03:00