Commit Graph

5685 Commits

Author SHA1 Message Date
0b4320fb1d Merge branch '2.0' into develop 2016-09-12 09:39:26 +03:00
8be833640f Change restart type to on-abort
MaxScale should only restart if an abort is detects, i.e. MaxScale
crashes.
2016-09-12 09:35:11 +03:00
0d157b16f8 Fix luafilter build failure
The createInstance used the old signature.
2016-09-12 06:50:07 +03:00
2d229927fe Fix broken if in poll.c
One if was not working due to an extra semicolon at the end of the line.
2016-09-12 06:46:56 +03:00
e26f3795e2 Remove useless parts from CHK_LOGFILE
The CHK_LOGFILE macro first asserts that the values being checked are
valid and then proceeds to evaluate it again. The result of this
evaluation was not assigned to anything and it caused GCC 6.1.1 to produce
a warning.
2016-09-11 20:37:50 +03:00
717b623587 Fix crash in server_free
server_free tried to free a char array which wasn't malloc'ed.
2016-09-09 20:39:16 +03:00
76ea31bc2d Add MXS-812 to release notes
MXS-812 is now mentioned in the 2.0.1 release notes.
2016-09-09 17:02:41 +03:00
7a144079b9 MXS-812: Fix active operation counters
When a client executes commands which do not return results (for example
inserting BLOB data via the C API), readwritesplit expects a result for
each sent packet. This is a somewhat of a false assumption but it clears
itself out when the session is closed normally. If the session is closed
due to an error, the counter is not decremented.

Each sesssion should only increase the number of active operation on a
server by one operation. By checking that the session is not already
executing an operation before incrementing the active operation count the
runtime operation count will be correct.
2016-09-09 16:57:18 +03:00
4a95439a8d Don't restart even on abnormal failures
If systemd restarts MaxScale when an abnormal exit is detected, it is
likely to happen again. This leads into a loop which causes multiple
maxscale processes on the same machine. One example of this behavior is
when systemd times MaxScale out when it is starting.
2016-09-09 16:38:27 +03:00
a32b4bdf6b Add missing examples to installation
The CDC examples are now installed if the CDC protocol module is built.
2016-09-09 16:01:16 +03:00
f161c1e423 Add section about changed defaults to release notes
A list of changes in the defaults is good to have in the release notes.
2016-09-09 15:57:30 +03:00
633f01c3df Merge pull request #110 from mariadb-corporation/GL-doc-fix
Clarify detect_stale_master defaults
2016-09-09 15:57:07 +03:00
559f740910 Clarify detect_stale_master defaults 2016-09-09 14:34:13 +02:00
d7f79942be Merge branch '2.0' into develop 2016-09-09 15:12:58 +03:00
abd1ea53a6 Add tarball installation instructions 2016-09-09 13:24:49 +03:00
b6d743fd03 Create MaxScale directories
If the installation directory is something else than /usr,
then the directories

    <install-dir>/var/cache/maxscale
    <install-dir>/var/log/maxscale
    <install-dir>/var/run/maxscale

will be created at installation time.
2016-09-09 11:00:06 +03:00
a87a9c75e5 Add --basedir flag
If maxscale is invoked with '--basedir=PATH', all directory paths
and the configuration file to be defined relative to that path.
2016-09-09 10:53:36 +03:00
60c61157cc Update limitations document
The document is now split into module type sections. Added documentation on the
limitations on multiple monitors monitoring the same servers and filters not
receiving complete packets when used with readconnroute.
2016-09-08 23:40:39 +03:00
f798bc9f64 Print correct default directories
Invoking 'maxscale --help' now displays the correct default
directories.
2016-09-08 14:33:21 +03:00
a074605c58 MXS-825: Add support for --execdir
Although claimed in the output of "--help", the long option
"--execdir" was not supported. Support for that now added.

The long options have now also been sorted in the same order
as the options are displayed by the help, to make it easy to
check that everything is there.

Further, the description column of the output of --help has
been aligned.
2016-09-08 13:17:53 +03:00
a474dad753 Fix crash when multiple MySQL monitors monitor same servers
The monitors always freed and reallocated the memory for the slaves. It
was always of the same size so a static array of that size should also
work.
2016-09-08 13:02:27 +03:00
07588a515d Update Replication-Proxy-Binlog-Router-Tutorial.md
Removed "servers=" in the example
2016-09-08 08:55:28 +02:00
4940e1482f Update Replication-Proxy-Binlog-Router-Tutorial.md
Removed "servers=" in the example
2016-09-08 08:52:14 +02:00
af896b8e86 Test modutil_get_next_MySQL_packet 2016-09-07 16:17:35 +03:00
7702d1f242 Correctly return a complete packet also when header split
Some special handling is needed if the first buffer in a chained
GWBUF does not contain at least 3 bytes.
2016-09-07 14:45:03 +03:00
5360918344 Make gwbuf_alloc_and_load const correct. 2016-09-07 12:31:26 +03:00
58a8bdd4ab Enlarge statistics variables from 32 to 64 bit
Apparently at least the epoll cycles can wrap. Also use
integer types of explicit size.
2016-09-07 10:41:06 +03:00
a4903cff73 Accept 'password' in addition to 'passwd'
In the configuration section of services and monitors, the
password to be used can now be specified using 'password'
in addition to 'passwd'.

If both are provided, then the value of 'passwd' is used. That
way there cannot be any surprises, should someone for whatever
reason currently (in 1.4.3 an invalid parameter will not prevent
MaxScale from starting) have a 'password' entry in his config file.

In the next release 'passwd' can be deprecated and in the release
after that removed.
2016-09-07 09:41:38 +03:00
fca09e0d7b MXS-836: Fix retry_on_failure not working
The service start retry mechanism mistakenly returned an error when a
service failed to start but a retry was queued. This caused MaxScale to
stop whenever a service failed to start.
2016-09-06 15:41:41 +03:00
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