7653 Commits

Author SHA1 Message Date
Markus Mäkelä
3fd82ebae6 MXS-1220: Add alter maxscale MaxAdmin command
A set of the core MaxScale parameters can now be altered at runtime. This
set consists of the authentication timeouts and the admin interface
authentication. Other parameters either can't be modified due to internal
limitations or aren't sensible to modify at runtime.
2017-05-24 15:05:11 +03:00
Markus Mäkelä
69be4d263f MXS-1220: Add admin interface parameters to /maxscale/ resource
The admin interface parameters are now a part of the /maxscale/ resource.
2017-05-24 15:05:11 +03:00
Markus Mäkelä
e6f79953b9 Add missing dependencies to Travis builds
The gnutls and gcrypt packages were missing.
2017-05-24 15:05:11 +03:00
Markus Mäkelä
1067fd352c MXS-1220: Add creation and deletion of admin users
Admin users can now be created via the REST API. This allows remote
management of the administrative interface itself.
2017-05-24 15:05:11 +03:00
Markus Mäkelä
ead9059eeb MXS-1220: Add /users/ resource
The /users/ resource shows all user accounts that can be used with
MaxScale. This resource is further split into two resource collections,
/users/inet and /users/unix, which contain the network users and Linux
accounts respectively.
2017-05-24 15:05:10 +03:00
Markus Mäkelä
7fc2d25cf2 MXS-1220: Allow new REST API users to be created
The REST API now uses the same users as MaxAdmin network interface. This
allows them to be created with MaxAdmin.

The next step is to add user creation to the REST API.
2017-05-24 15:05:10 +03:00
Markus Mäkelä
db78eae9a8 MXS-1220: Use thread-local buffer for errors
The runtime error buffer is now a thread-local buffer. This fixes the
build failure on older systems where the compiler doesn't allow
thread-local non-POD objects to be created.

Also expanded some of the JSON validation functions so that they provide
better errors.
2017-05-24 15:05:10 +03:00
Markus Mäkelä
e3c4bd7f72 MXS-1220: Add more validation checks to request JSON
The requests that send a body should define at least a `data` member.

Added a simple test that checks that bad requests are rejected. This test
should be expanded to check that the returned error body contains the
correct members.
2017-05-24 15:05:10 +03:00
Markus Mäkelä
75e7ac35ed MXS-1220: Always build libmicrohttpd
This allows MaxScale to use the PATCH functionality that's only in the
newer versions of the library. It also removes some of the problems that
exist with older systems that don't support all of the options.
2017-05-24 15:05:10 +03:00
Timofey Turenko
c653a2121d fix avro dir 2017-05-23 21:09:30 +03:00
Timofey Turenko
4ab5db2cff fix avro build 2017-05-23 21:09:30 +03:00
Timofey Turenko
fb439e0f4a add build and test scripts 2017-05-23 21:09:30 +03:00
Timofey Turenko
82f18d1c7e install deps script cleanup 2017-05-23 21:09:30 +03:00
Timofey Turenko
8c6ca38a8a add tests 2017-05-23 21:09:30 +03:00
Esa Korhonen
dbfd631fed Change session registry to a template class
The template class wraps a HashMap such that only a few operations
are allowed. Usage requires specializing a RegistryTraits class
template for each entry type.
2017-05-19 10:16:37 +03:00
Markus Mäkelä
322983a5f4 Merge branch '2.1' into develop 2017-05-17 13:48:52 +03:00
Markus Mäkelä
3b8bda289e Update Resources-Session.md
Removed unimplemented features and updated response content.
2017-05-17 10:14:57 +03:00
Markus Mäkelä
f1c790db52 MXS-1220: Add logging priorities to logs resoure
The logging priorities can now be queried and altered.
2017-05-17 10:14:57 +03:00
Markus Mäkelä
05cb49d48a MXS-1220: Add error messages to bad request
Requests now contain a JSON API-conforming, human-readable error message.
2017-05-17 10:14:57 +03:00
Markus Mäkelä
ac29abd679 MXS-1220: Add support for X-HTTP-Method-Override
This header allows clients to override the request method to work around
client library limitations.
2017-05-17 10:14:57 +03:00
Markus Mäkelä
e01e4ee661 Update Resources-MaxScale.md
Updated the responses and added missing resources.
2017-05-17 10:14:56 +03:00
Markus Mäkelä
adbf537d80 MXS-1220: Add more information to the /maxscale/ resource
The /maxscale/ resource now has values for most of the configuration
parameters in the [maxscale] section as well as the version, commit and
uptime information.
2017-05-17 10:14:56 +03:00
Markus Mäkelä
551f635f50 MXS-1220: Make the http.hh header public
As it contains utility functions for formatting time_t values to HTTP-date
values, there's no real need to make it an internal header.
2017-05-17 10:14:56 +03:00
Markus Mäkelä
112977e011 Update Monitor-Common.md
Minor changes to wording.
2017-05-17 10:14:56 +03:00
Markus Mäkelä
3b9f7a74b6 Update Resources-Monitor.md
Updated monitor resource documentation with new response output.

Added links to standard monitor parameters that can be modified.
2017-05-17 10:14:56 +03:00
Markus Mäkelä
46b07861fe Update Monitor-Common.md
Added missing `user` and `password` documentation.
2017-05-17 10:14:56 +03:00
Markus Mäkelä
e7a6aec010 Update Resources-Filter.md
Updated filter resource documentation with up-to-date request output.
2017-05-17 10:14:56 +03:00
Markus Mäkelä
56cf06ee08 Don't use explicit struct initialization
Older GCC versions don't seem to support explicit struct member
initialization.
2017-05-16 11:39:57 +03:00
Markus Mäkelä
17ba824d9f Only close valid sessions
When a session is being closed, the state needs to be checked. If the
session creation failed, the session need to be only freed.
2017-05-16 11:39:57 +03:00
Markus Mäkelä
39ca791a49 Assign service pointer for cloned tee DCBs
When a cloned DCB is created, the service pointer is not copied and it
needs to be manually set in the newSession entry point. This most likely
due to the fact that the cloned DCB always has a different service and it
is not possible to deduce it.

Another option would be to pass the target service as a parameter but the
whole DCB cloning process could use with a rewrite so any modifications
beyond the required minimum are wasteful.
2017-05-15 19:32:02 +03:00
Markus Mäkelä
159c8bb5d1 Listen for only EPOLLIN events with listeners
The example in the epoll(7) manpage only sets the EPOLLIN event flag.

Although it is not explicitly stated that only EPOLLIN events arrive for
sockets that are listening, any other types of events should not be
relevant for listeners.
2017-05-15 19:32:02 +03:00
Markus Mäkelä
4117dcf410 Only store established connections in the pool
If a connection has not been fully established (i.e. authentication has
been completed) then it should not be considered as a connection pool
candidate.
2017-05-15 19:32:02 +03:00
MassimilianoPinto
2d7df3eb89 Merge branch 'develop' into MXS-1209 2017-05-15 10:39:07 +02:00
Markus Mäkelä
4050cd20d8 Merge branch '2.1-merge-2.0' into 2.1 2017-05-15 10:36:58 +03:00
Markus Mäkelä
0c9409ae7f Merge branch '2.0' into 2.1-merge-2.0 2017-05-15 10:35:44 +03:00
Markus Mäkelä
5a0d2c54bd MXS-1216: Fix DATETIME(n) value interpretation
The DATETIME(n) values generated by a MariaDB 10.0 server were not
interpreted correctly as the wrong algorithm was used to extract the
values.

DATETIME(0) values still do not work properly and they require further
debugging and changes to the code.
2017-05-15 10:25:12 +03:00
Markus Mäkelä
a12d19591e MXS-1216: Store field real type and length in Avro schema
The avro schema allows custom properties to be defined for the schema
fields. The avrorouter stored extra information about the table into the
schema for later use.

Currently, this information is only generated by the avrorouter
itself. Further improvements to the schema generator scripts need to be
done.
2017-05-15 10:25:12 +03:00
Markus Mäkelä
6b6a7fa4a1 Do checkpoint processing at end of binlog
When the binlog has been read, it needs to be treated as if the
transaction or row limit has been hit. This will cause all tables to be
flushed to disk before the files are indexed.
2017-05-15 10:25:11 +03:00
Markus Mäkelä
8a288110a9 Rename conflicting Avro fields
When a user defined field conflicts with an internal MaxScale field, the
field is suffixed with an underscore.
2017-05-15 10:25:11 +03:00
Markus Mäkelä
926930e241 MXS-1216: Correct CHAR(n) handling
The field length was wrongly compared to less than 255 for two byte field
lengths. In addition to that, the metadata was interpreted in the wrong
way.
2017-05-15 10:25:09 +03:00
Markus Mäkelä
c988735a03 MXS-1216: Fix crash on MariaDB 10.0 DATETIME(n)
When a MariaDB 10.0 DATETIME field with a custom length was defined, the
field offsets weren't calculated properly.

As there is no metadata for pre-10.1 DATETIME types with decimal
precision, the metadata (i.e. decimal count) needs to be gathered from the
CREATE TABLE statement. This information is then used to calculate the
correct field length when the value is decoded.

This change does not fix the incorrect interpretation of the old DATETIME
value. The converted values are still garbled due to the fact that the
value needs to be shifted out of the decimal format before it can be
properly converted.
2017-05-15 10:25:06 +03:00
Markus Mäkelä
a7b919e8e7 Update Avrorouter-Tutorial.md
Fixed field names.
2017-05-15 08:42:29 +03:00
Markus Mäkelä
7ee96c411b Update RabbitMQ-And-Tee-Archiving.md
Fixed extra whitespace.
2017-05-15 08:42:29 +03:00
Timofey Turenko
047ac55a40 minor docs fixes 2017-05-15 08:42:29 +03:00
Timofey Turenko
b85b4010f2 docs typos fixing 2017-05-15 08:42:29 +03:00
Markus Mäkelä
ed653ac729 Merge branch '2.0' into 2.1-merge-2.0 2017-05-14 10:25:12 +03:00
Markus Mäkelä
18c71a8ebd MXS-1220: Fix build failure with older GCC
Older GCC versions seem to have a bug where `struct sockaddr_in` pointers
cannot be accessed directly and need to be dereferenced first.
2017-05-14 10:07:16 +03:00
Markus Mäkelä
b317f66335 MXS-1220: Update server resource documentation
Updated documentation with latest resource layouts. Expanded explanations
on how to modify the servers. Use the correct resource endpoints.
2017-05-14 10:07:09 +03:00
Markus Mäkelä
ffc6dba720 MXS-1220: Fix error on PUT request with no parameters
Whena server was modified and no parameters were given, the operation was
reported as a failure even though it was successful.
2017-05-14 10:06:02 +03:00
Markus Mäkelä
ca7b24f6fa MXS-1220: Allow admin interface to be disabled
Allowing the admin interface to be disabled completely makes it possible
to remove any security concerns that could arise from its use.
2017-05-14 10:06:02 +03:00