Commit Graph

5756 Commits

Author SHA1 Message Date
3e08c248b9 Fix maxinfo hang
dcb_count_by_usage did not iterate the list properly and would get stuck on the
first inactive DCB. Since this function is only called by maxinfo, it would be
the only one to get stuck.
2016-09-06 14:31:34 +03:00
0aec0c483c Cleanup early error logging
If the log file could not be opened, it was reported over and
over and over again to stderr.
2016-09-06 10:50:13 +03:00
ca6c619d60 Do not access uninitialized file object
If the opening of the logfile fails it must not be assumed
to have been opened when cleaning up.
2016-09-06 10:49:41 +03:00
4e3de4c56d Rename and relocate CDC Python examples
Moved the CDC example scripts into the protocol directory and added the .py
suffix. Fixed all references to these scripts.
2016-09-05 10:32:37 +03:00
ce0b82ef25 Ensure buffer has enough space
In the case of a Unix domain socket, the required buffer size may
in principle be up to PATH_MAX, so better to explicitly ensure that
there's enough space.
2016-09-05 10:26:27 +03:00
741ba5e444 Fix links to MaxScale repo
The links now point to the correct repo.
2016-09-05 10:20:04 +03:00
1e59e04002 Fix MaxScale repo links
The links in the release notes for 2.1 now point to the right place.
2016-09-05 10:19:15 +03:00
c7907ed728 Fix minor leak in maxscaled.c 2016-09-02 13:58:34 +03:00
a9b0a5550c Allow socket and address/port to be used with maxadmin
It's now possible to use both a Unix domain socket and host/port
when connecting with MaxAdmin to MaxScale.

By default MaxAdmin will attempt to use the default Unix domain
socket, but if host and/or port has been specified, then an inet
socket will be used.

maxscaled will authenticate the connection attempt differently
depending on whether a Unix domain socket is used or not. If
a Unix domain socket is used, then the Linux user id will be
used for the authorization, otherwise the 1.4.3 username/password
handshake will be performed.

adminusers has now been extended so that there is one set of
functions for local users (connecting locally over a Unix socket)
and one set of functions for remote users (connecting locally
or remotely over an Inet socket).

The local users are stored in the new .../maxscale-users and the
remote users in .../passwd. That is, the old users of a 1.4
installation will work as such in 2.0.

One difference is that there will be *no* default remote user.
That is, remote users will always have to be added manually using
a local user.

The implementation is shared; the local and remote alternatives
use common functions to which the hashtable and filename to be
used are forwarded.

The commands "[add|remove] user" behave now exactly like they did
in 1.4.3, and also all existing users work out of the box.

In addition there is now the commands "[enable|disable] account"
using which Linux accounts can be enabled for MaxAdmin usage.
2016-09-02 13:47:16 +03:00
8ac9ecdf07 Compilation error fix
Compilation error fix
2016-09-01 17:59:04 +02:00
4e1cb56710 Added support for ANNOTATE_ROWS_EVENT in COM_BINLOG_DUMP
Now registration with MariaDB server supports ANNOTATE_ROWS_EVENT.
Request flag is in COM_BINLOG_DUMP packet
2016-09-01 17:44:41 +02:00
d337aa0476 Backport hint priority change to 2.0
The change in readwritesplit routing priorities, where hints have the
highest priority, gives users more options to control how readwritesplit
acts.

For example, this allows read-only stored procedures to be routed to
slaves by adding a hint to the query:

       CALL myproc(); -- maxscale route to slave

The readwritesplit documentation also warns the user not to use routing
hints unless they can be absolutely sure that no damage will be done.
2016-08-31 17:44:26 +03:00
099263709e Allow routers to control when users are loaded
The binlogrouter requires that users are not loaded at startup. This
allows it to inject the service user into the list of valid MySQL users so
that the binlogrouter can be controlled via the listeners.
2016-08-31 07:02:30 +03:00
9a3da88e63 Move loading of user data to authenticator modules
The authenticator modules now load the user data when the new loadusers
entry point is called. This new entry point is optional.

At the moment the code that was in service.c was just moved into the
modules but the ground work for allowing different user loading mechanisms
is done.

Further improvements need to be made so that the authenticators behave
more like routers and filters. This work includes the creation of a
AUTHENTICATOR module object, addition of createInstance entry points for
authenticators and implementing it for all authenticators.
2016-08-31 07:02:30 +03:00
94aecf4ada Prepare for local/remote admin users
Local admins are the ones accessing MaxScale on the same host
over a Unix domain socket, and who are strongly identified), and
optional remote admins are the ones accessing MaxScale potentially
over a tcp socket (potentially over the network), and who are
weakly identified.

These are completely separate and a different set of functions
will be needed for managing them. This initial change merely
renames the functions.
2016-08-30 15:53:29 +03:00
e54cc95a20 Use server weights when choosing the candidate master
With this change, if two master servers both have equal depths but
different weights, the one with the higher weight is used. If the depths
and weights are equal, the first master listed in the configuration is
used.
2016-08-30 13:40:45 +03:00
71bc30be5b Update limitations document on wait_timeout
The document now describes readwritesplit's behavior when wait_timeout is
configured to a low value.
2016-08-30 13:40:45 +03:00
248a58629b MXS-845: Ignore Maintenance state in state change logic
When a server goes into maintenance, the current state is set to
Maintenance and the previous state is left unmodified. The function which
checks for state changes uses the current and previous values and simply
compares them. Since servers in maintenance mode aren't monitored, the
function always returned true when servers were in maintenance mode.

When the state change to or from maintenance is ignored, the state change
function works. With this fix, users can safely put servers into
maintenance without having to worry about the scripts being executed. This
also allows the scripts themselves to put servers into maintenance.
2016-08-30 13:40:45 +03:00
146fb50cdb Tune maxscaled error message 2016-08-29 14:09:14 +03:00
c05f6b394f Change 0 to NULL 2016-08-29 10:02:37 +03:00
9a6a528a3f MXS-797 Add initial version of cache filter
The cache filter consists of two separate components; the cache
itself that evaluates whether a particular query is subject to
caching and the actual cache storage. The storage is loaded at
runtime by the cache filter. Currently using a custom mechanism;
once the new plugin loading macros/mechanism is in place, I'll see
if that can be used.

There are a few open questions/issues.

- Can a GWBUF delivered to the filter contain more MySQL packets
  than one? If yes, then some queueing mechanism needs to be
  introduced. Currently the code is written so that the packets
  are processes in a loop, which will not work.
- Currently, the storage API is synchronous. That may work with a
  storage built upon RocksDB, that writes asynchronously to disk,
  but not with memcached that can be (and in MaxScale's case
  would have to be) used asynchronously.

  Reading may be problematic with RocksDB as values are returned
  synchronously. So that will stall the thread being used. However,
  as RocksDB uses in-memory caching and it is possible to arrange
  so that e.g. selects targeting the same table are stored together,
  it is not obvious what the impact would be.

  So as not to block the MaxScale worker threads, there'd have to
  be a separate thread-pool for RocksDB access and then arrange
  the data to be moved across.

  But initially, the inteface is synchronous.
- How is the cache configured? The original requirement mentions
  all sorts of parameters - database name, table name, column name,
  presence of WHERE clause, regexp, date/time of query, user -
  but it's not alltogether clear exactly how they should be specified
  and how they should interract. So initially all selects will
  be subject to caching with a TTL.
2016-08-29 10:00:42 +03:00
85b3d7c465 Make the instance name available to filters
The section name of a filter in the MaxScale configuration
file is unique for each filter. Hence, by providing that name
to the filter instance creation function, it is possible to
act differently depending on which particular instance is
being created.

Case in point.

There can be multiple cache filters defined in the MaxScale
configuration file, each with a different set of rules, ttl
and even backing store.

Each cache will be backed by a separate storage that e.g.
in the case of RocksDB will correspond to a particular path.

In other words, for each cache instance corresponding to a
particular cache definition in the MaxScale configuration file,
we need to be able to create a unique path.

If the filter section name (in the MaxScale configuration file)
that anyways needs to be unique, is provided to the filter, then
that name can be used when forming the unique path.

The alternative is to require the DBA to provide some unique
parameter for each cache definition, which adds configuration
overhead and is errorprone.

Furthermore, by providing the name to filters, also error
messages can be customized for a particular section when
appropriate.
2016-08-29 09:33:34 +03:00
e782344115 Prevent leakage when filters are shared
Previously, if the same filter was used by multiple services,
the filter instance was created multiple times, yet only the
last created instance was used.
2016-08-29 09:31:28 +03:00
4c6481bae7 Make resultset const correct 2016-08-26 15:39:03 +03:00
a601ad213e Make define C++ compatible
C++11 requires a space between literal and string macro.
Does not change the content or layout of GW_MYSQL_VERSION.

RocksDB must be compiled with C++11.
2016-08-26 15:23:32 +03:00
82c14498e9 Remove double typedef from monitor.h
Struct monitor was typedef'ed twice which caused compilation problems on
CentOS 6. Removing the latter definition fixes that.
2016-08-24 17:33:31 +03:00
67cfafb23c Enhance MaxAdmin info in 2.0 Upgrading document 2016-08-24 14:26:00 +03:00
a0f905bbe9 Make maxscaled upgrade friendlier
Currently, if the address/port information of a maxscaled protocol
listener is not updated to socket when MaxScale is upgraded to 2.0,
maxscaled would not start, with the effect of a user loosing maxadmin
after an upgrade.

After this change, if address/port information is detected, a warning
is logged and the default socket path is used. That way, maxadmin will
still be usable after an upgrade, even if the address/port information
is not updated.
2016-08-24 14:00:19 +03:00
e231236cee Add missing filters to filter/CMakeLists.txt 2016-08-24 09:32:48 +03:00
64b0b63f49 Merge pull request #109 from mariadb-corporation/+-patch-1-1
Correct typo in debugcli.c
2016-08-23 13:50:40 +03:00
5b4208898d Correct typo in debugcli.c 2016-08-23 12:30:32 +02:00
6f236b6592 Update auroramon prototypes
No longer void*, but MONITOR and CONFIG_PARAMETER.
2016-08-22 09:51:45 +03:00
d7ff95a2c3 Add note about auroramon to release notes
The release notes now mention the Aurora monitor. Also fixed a typo.
2016-08-19 17:12:18 +03:00
25138f6081 MXS-796: Initial implementation of the Aurora monitor
The Aurora monitor inspects the status information in the
`replica_host_status` table in the `information_schema` database. Using
this information the monitor determines which of the nodes is the master
for of this Aurora cluster.

This monitor also supports monitor scripts as described in
Monitor-Common.md.
2016-08-19 15:13:14 +03:00
5e7de52f3a MXS-796: Add Aurora monitor documentation
Added the documentation for Aurora monitor. The documentation describes the
monitoring process and how to configure the monitor.
2016-08-19 14:24:02 +03:00
052072a198 Allow multiple components to be installed
Allowing multiple components to be installed makes it possible to build
and install the core and experimental modules at the same time.
2016-08-19 13:49:14 +03:00
3eb25df676 Update monitor APIs
No need to use void* as the types of the arguments in the monitor
functions as the types are known and will always be the same.
2016-08-19 11:21:01 +03:00
edb5236e2c Add skeleton cache filter
Currently a nop-filter; complete but useless.
2016-08-19 10:30:10 +03:00
cf7988c8e3 Move all monitors into subdirs of their own
Each monitor module now resides in a subdirectory of its own.
The name of the subdirectory is the same as the name of the
library in the module's CMakeLists.txt file.
2016-08-18 13:35:28 +03:00
47c69c3e96 Move all protocols into subdirs of their own
Each protocol module now resides in a subdirectory of its own.
The name of the subdirectory is the same as the name of the
library in the module's CMakeLists.txt file.
2016-08-18 13:33:55 +03:00
acb19c083d Add hard thread limit
The hard thread limit is now defined in maxscale/limits.h.
If the specified number of threads is larger than that, it will
be adjusted down. The size of the GWBITMASK is now also defined
using that number, so there will always be enough bits for
representing all threads.
2016-08-18 12:55:45 +03:00
6028bf8f6c Move all routers into subdirs of their own
Each router module now resides in a subdirectory of its own.
The name of the subdirectory is the same as the name of the
library in the module's CMakeLists.txt file.
2016-08-18 11:10:04 +03:00
ed96e2c54a Make GWBITMASK fixed size
Originally GWBITMASK was capable of extending itself dynamically,
a functionality that in practice was never used, and that, in fact,
was broken.

As GWBITMASK is used for a single purpose inside MaxScale, its size
is now fixed at 256 bits, which is sufficient for 256 threads. Its
fixed size removes a few potential error situations that now then
do not need to be dealt with. And in principle is also more
performant.

In a separate change, bitmask_free will be renamed to bitmask_finish,
as contrary to free-functions in general, the function does not free
the argument, but only its data. The implementation will be empty,
but the function left in place for symmetry reasons (alloc/free,
init/finish).
2016-08-18 09:37:03 +03:00
1f10b6337e Move all filters to subdirs of their own
The name of the subdir is the same library name in the
filter's CMakeLists.txt file.
2016-08-17 16:37:27 +03:00
d34e2da62e Add MXS_ABORT_IF_FALSE 2016-08-17 15:08:08 +03:00
ec08f1b276 Add script for updating Change Date
Running

    $ script/update-change-date 2019-01-01 2019-07-01

will update the Change Date in a file from 2019-01-01 to 2019-07-01,
provided the change date looks exactly like

    Change Date: YYYY-MM-DD
2016-08-17 11:02:43 +03:00
dc7f7b6fb4 All changes 2.0.0...develop
973b983 Merge branch 'release-2.0.0' into develop
255dd23 Make spinlock functions take const argument
6e23bab Fix bitmask reallocation
338c189 Rename and clean up slavelag filter
3ea8f28 Fix possible NULL pointer dereference
bfe6738 MXS-830: Add module information to logged messages
1fad962 Fix strncat usage
d38997a Adjust log throttling policy
0be4e4b Add hashtable_item_strcasecmp
726100e Take hashtable convenience functions into use
5e7744a Fix typo in maxadmin.md
c5778c8 Merge branch 'release-2.0.0' into develop
b5762af Move from tmpnam to mkstemp
d6f2c71 Add convenience functions to hashtable
359058a MXS-825: Add support for --execdir
636347c Enable runtime reconfiguration of log throttling
ef9fba9 Improve log throttling documentation
aef917a Implement log throttling
e3a5349 Remove shardrouter.c
8051e80 Remove custom qc_sqlite allocation functions
fd34d60 Initial implementation of the learning firewall
a8752a8 Removed "filestem option" from example
1ef2519 Removed "filestem option" from example
0815cc8 Cleanup spinlock.h
ab4dc99 Clean up hashtable.h
ef2c078 Add prototypes for hashtable copy and free functions
fb5cfaf Add 'log_throttling' configuration entry
300d823 Add proper prototypes for hashtable hash and cmp functions
1c649aa qc_mysqlembedded: Include skygw_...h without path.
d276160 Add missing RPM scripts
e70e644 Fix HTTPAuth installation
1b2b389 Combine utils into the server directory
3ff9913 Add missing utils headers to devel package
407efb2 Fix minor packaging problems
99aa6ad Split MaxScale into core, experimental and devel packages
1290386 Merge branch 'develop' of ssh://github.com/mariadb-corporation/maxscale-new into develop
e59f148 Make scripts POSIX sh compatible
7319266 Fixed SHOW SLAVE STATUS in bonlog router
f8d760a Update Binlogrouter.md
0a904ed Update Replication-Proxy-Binlog-Router-Tutorial.md
75d4202 Update Replication-Proxy-Binlog-Router-Tutorial.md
b8651fc Add missing newline in listmanager.h
c7ad047 Add note about user data caches to release notes
70ccc2b Merge branch 'release-2.0.0' into develop
575d1b6 Mistake - dummy session needs list markers set.
8364508 Merge branch 'develop' into binlog_server_semisync
868b902 Update MaxScale limitations
2c8b327 Store listener caches in separate directories
6e183ec Create unique user data caches for each listeners
f643685 Don't free orphaned tee filter sessions
4179afa Allow binlogrouter to be used without a listener
7ad79af Add function for freeing a listener
677a0a2 Move authentication data from services to listeners
4f12af7 Merge remote-tracking branch 'origin/MXS-677' into develop
1419b81 Semi-Sync support to binlog server: code review updtate
0ea0f01 Semi-Sync support to binlog server: added missing routine
4aad909 Semi-Sync support to binlog server
b824e1e Add authenticator support to httpd.c
705a688 Change tabs to spaces
d0c419e Change method of adding list fields to e.g. DCB
25504fc Document the changed routing priority of hints
41666d1 Remove use_ssl_if_enabled global option
a3584e9 Make routing hints have highest priority
34a1d24 Updated document with new binlog router option
01eedc5 Updated documentation with SSL usage
8a4c0f6 Update Replication-Proxy-Binlog-Router-Tutorial.md
4e374aa Update Replication-Proxy-Binlog-Router-Tutorial.md
f3f3c57 Update Replication-Proxy-Binlog-Router-Tutorial.md
617b79f Binlog Server: error messages typo fix
fa8dfae Binlog Server: error messages review
1b8819c Fix freeing of schemarouter session memory
07f49e1 MXS-788: new code review fix
1fd3b09 MXS-788: show services now displays SSL info
6ca2584 MXS-788 code review fix
ae6a7d0 MXS-788 code review
43d3474 Master server SSL connection
90b2377 Use correct variable in listmanager pre-allocation
9a5b238 Fix listmanager pre-allocation
9c78625 Fix a memory leak when backend authentication fails
e59a966 Fix hang in list_find_free
ff30223 Fix freeing of shared data in schemarouter
fc8f9d3 Add missing include in luafilter
ecf7f53 Add missing NULL value to filter parameter array
636d849 Update memory allocation approach
f0d1d38 Add new allocation functions
97d00a0 Fix writing of uninitialized data to logs
e72c9b2 Merge branch 'release-2.0.0' into develop
cf2b712 Merge branch 'release-2.0.0' into develop
8917c5c Change the logic behind valid list entry checks
c10deff Improve documentation about version_string
f59f1f7 Merge branch 'develop' of ssh://github.com/mariadb-corporation/maxscale-new into develop
c88edb3 Backend authentication failure improvement
abd5bee Revert "Backend authentication failure improvement"
5bb3107 Backend authentication failure improvement
b7f434a Add new allocation functions
3f022fa Fix stupid mistake
99c4317 Merge remote-tracking branch 'origin/MXS-677' into develop
3c1ded6 Added connection/authentication failure error reporting in SHOW SLAVE STATUS
0a60f7b Tidy up and deal with review points.
ba103ff blr_slave.c: Update strncpy usage
467331e blr_master.c: Strncpy usage updates
d2b7c0c Merge remote-tracking branch 'origin/develop-nullauth-merge' into develop
5a8c1d0 qc: Measure execution time at the right place.
bccdb93 Merge branch 'NullAuthDeny' into develop
2e6511c Add 5.5.5 prefix to all version strings that lack it
314655a Improve DCB and session initialization and list handling
e1c43f0 MXS-655: Make MaxScale logging logrotate(8) compatible
ce36afd MXS-626: Don't log a header unless maxlog enabled
dcd47a7 blr_file.c: Replace uses of strncpy
6b8f576 bls_slave.c: Replace strncpy with memcpy
68a0039 Add list preallocation, tidy up, simplify init.
cb37d1b Fix copyright etc headers.
11a400d Tidy; comment; fix bad copies and mistakes.
7e36ec4 Add list manager files.
c4794e3 Initial code for list manager.
1b42e25 Merge remote-tracking branch 'origin/MXS-765' into develop
d50f617 Fix problems, extend tests, respond to review.
dcb4a91 Filter test folder removed
0b60dbe Add a couple of comments.
83cdba0 Fix overwriting problem.
ba5d353 Fix overwriting problem.
53671cb Small fixes in response to review.
173d049 blr.c: Review strncpy usage
4ff6ef2 binlog_common.c: Replace strncpy with memcpy
f238e03 maxbinlogcheck.s: Replace strncpy
9807f8d harness: Replace unnecessary use of strncpy
8c7fe6a avro: Modify strncpy usage
9b8008e Small improvements.
b7f784f Fix mistakes in testqueuemanager.c
cc26962 Restore missing poll.c code; add testqueuemanager.c.
2e91806 Format the filter harness
22059e6 Initial implementation connection queueing.
c604dc2 readwritesplit.c: Improve COM_INIT_DB handling
454d920 schemarouter.c: Replace strncpy with strcpy
8e85d66 sharding_common.c: Too long a database name handled explicitly
77f4446 Astyle schemarouter
491f7c2 maxinfo.c: Replace strncpy with memcpy
6b98105 maxinfo: Reformat with astyle
c1dbf08 Handle oversize user and database names
5fa4a0f Merge branch 'develop' of ssh://github.com/mariadb-corporation/maxscale-new into develop
706963b BLR_DBUSERS_TAIL new var in blr.h
d75b9af Tweak comments, remove trailing blanks.
ab2400a Optimise statistics gathering by inline & simpler fns.
fb59ddc Remove unnecessary strncpy/strncat usage in Binlog Server
bdcd551 resultset.c: Change strncpy to memcpy
c6b1c5e Reject rather than cut too long a path
6d8f112 Remove unnecessary strncpy/strncat usage
18bf5ed Remove unnecessary strncpy usage
dc0e2db Make maxpasswd more userfriendly
c9c8695 Fix calculation of padded_len in encryptPassword
2cfd2c6 dbusers.c: Check strncpy usage
7ab9342 Make more thorough checks in secrets_readKeys
be7d593 Format cli.c debugcli.c testroute.c webserver.c
1ee5efb config.c: Check usage of strncpy
3043b12 gq_utils.c: Unnecessary use of strncpy removed
77874ac Add help to maxkeys
38392a3 Update secrets_writeKeys documentation
2d1325c Make SSL optional in MaxScale's own communication
bda00da Fix avro build failures
b2cb31a Add more OOM macros
41ccf17 Fix strdup usage
a48f732 Fix realloc calls
20771f6 Add forgotten extern "C" block
8faf35a Add maxscale allocation functions
bb47890 Add macros for OOM logging
afea388 Fix silly mistakes.
6dafd22 Make deny default for null auth; move code from common to auth.
2016-08-17 10:06:35 +03:00
b2035745fc Fix and clean up CDC documentation
The CDC_users.md document was not linked to and was in the wrong place. It
should reside in the protocol directory since it relates to the CDC protocol.
2016-08-16 12:06:28 +03:00
33fb8effa1 Update Avrorouter tutorial
The tutorial now displays a single configuration example which should be easier
to understand.

Added a sub-section about configuring the master server with proper replication
settings and explained the need for the CREATE TABLE statements in the binary
logs.

Display an example Avro JSON schema and provide links to the schema definition
documents. Mention the cdc_schema utility as the second option for creating the
schema files.
2016-08-15 10:31:18 +03:00
54c50c5a52 Fix documentation links
The LICENSE and COPYRIGHT documents don't exist.
2016-08-15 10:31:09 +03:00