5702 Commits

Author SHA1 Message Date
Johan Wikman
86909b5067 Add macro for checking buffer contiguousness
A NULL buffer is considered contiguous.
2016-09-14 13:01:34 +03:00
Johan Wikman
65ccc6b8fb CMakeLists.txt cleanup
- maxscale-common no longer linked with libaio as it is not used.
2016-09-14 11:31:01 +03:00
Johan Wikman
9790eaaf20 storage_rocksdb explicity dependent on RocksDB 2016-09-13 11:45:03 +03:00
Johan Wikman
2cb6bdcf67 Fix typo on build variable 2016-09-13 11:45:03 +03:00
Johan Wikman
293b125e12 Define namespace function using explicit scope 2016-09-13 11:45:03 +03:00
Johan Wikman
cf86b80584 Link storage_rocksdb with libraries required by RocksDB 2016-09-13 11:45:03 +03:00
Johan Wikman
7fe981c22f Cache: Handle TTL manually
The RocksDB TTL database only honours the TTL when the database
is compacted. If the database is not compacted, stale values will
be returned until the end of time.

Here we utilize the knowledge that the TTL is stored after the
actual value and use the root database for getting the value,
thereby getting access to the timestamp.

It's still worthwhile using the TTL database as that'll give
us compaction and the removal of stale items.
2016-09-13 11:45:03 +03:00
Johan Wikman
a96d215aa0 Make it possible to include internal RocksDB headers
The RocksDB storage will need to refer to some internal
RocksDB files.
2016-09-13 11:45:03 +03:00
Johan Wikman
a76c05e8db MXS-797 Add initial version of RocksDB storage
RocksDB is cloned from github and version v4.9 (latest at the time of
this writing) is checked out.

RocksDB can only be compiled as C++11, which means that RocksDB and hence
storage_rocksdb can be built only if the GCC version is >= 4.7.

The actual storage implementation is quite straightforward.

- The key is a SHA512 of the entire query. That will be changed so that
  the database/table name is stored in the beginning of the key unhashed
  as that will cause cached items from the same table to be stored
  together. Assumption is that if you access something from a particular
  table, chances are you will access something else as well.
- When the SO is loaded, the initialization function will created a
  subdirectory storage_rocksdb under the MaxScale cache directory.
- For each instance, the RocksDB cache is created into a directory
  whose name is the same as the cache filter name in the configuration
  file, under that directory.
- The storage API's get and put functions are then mapped directly on
  top of RockDB's equivalent functions.
2016-09-13 11:45:03 +03:00
Markus Makela
82846785a7 Make modules depend on maxscale-core
All modules which are now installed automatically depend on the
maxscale-core target. This fixes concurrent builds failing due to missing
libraries.
2016-09-13 09:25:23 +03:00
Markus Makela
36e243e07d Refactor monitor_mysql_db functions
The different server monitoring functions all did similar work and
combining them into one function makes the whole process of monitoring a
server simpler.
2016-09-12 15:57:27 +03:00
Markus Makela
4cd36161ee Fix stale master detection in multimaster mode
The MySQL monitor now correctly assigns stale status to master servers.
2016-09-12 15:57:27 +03:00
Markus Makela
506ef1b9f6 Assign master status only to root level masters
If a relay master server is found in the replication tree, it should not
get the master status. Previously all master servers were assigned the
master status regardless of their depth in the replication tree.

By comparing the depth value of each potential master, the monitor can
find the right master at the root of the replication tree.
2016-09-12 15:57:27 +03:00
Markus Makela
46c8a6f66b MXS-839: Detect multi-master topologies with mysqlmon
The mysqlmon now supports proper detection of multi-master topologies by
building a directed graph out of the monitored server. If cycles are found from
this graph, they are assigned a master group ID. All servers with a positive
master group ID will receive the Master status unless they have `@@read_only`
enabled.

This new functionality can be enabled with the 'multimaster' boolean
parameter.
2016-09-12 15:57:27 +03:00
Markus Makela
d745781bd0 MXS-839: Store additional server information in mysqlmon
Mysqlmon now stores the values of read_only, slave_sql_running,
slave_io_running, the name and position of the masters binlog and the
replication configuration status of the slave.

This allows more detailed server information to be displayed with the
`show monitor <name>` diagnostic interface. In addition to this, the new
structure used to store them provides an easy way to store information
that is specific to a monitor and the servers it monitors.

These new status variables can be used to implement better multi-master
detection in mysqlmon by using the value of read_only to resolve
situations where multiple master candidates are available.
2016-09-12 15:57:27 +03:00
Markus Makela
cbf3ae0f8f Move gatekeeper and ccrfilter into the core
The filters should be a part of the core package.
2016-09-12 15:55:27 +03:00
Johan Wikman
d8bff00fa5 FAKE_CODE variables declared in header, defined in c-file 2016-09-12 15:09:05 +03:00
Markus Makela
0b4320fb1d Merge branch '2.0' into develop 2016-09-12 09:39:26 +03:00
Markus Makela
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
Markus Makela
0d157b16f8 Fix luafilter build failure
The createInstance used the old signature.
2016-09-12 06:50:07 +03:00
Markus Makela
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
Markus Makela
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
Markus Makela
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
Markus Makela
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
Markus Makela
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
Markus Makela
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
Markus Makela
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
Markus Makela
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
markus456
633f01c3df Merge pull request #110 from mariadb-corporation/GL-doc-fix
Clarify detect_stale_master defaults
2016-09-09 15:57:07 +03:00
Guillaume Lefranc
559f740910 Clarify detect_stale_master defaults 2016-09-09 14:34:13 +02:00
Johan Wikman
d7f79942be Merge branch '2.0' into develop 2016-09-09 15:12:58 +03:00
Johan Wikman
abd1ea53a6 Add tarball installation instructions 2016-09-09 13:24:49 +03:00
Johan Wikman
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
Johan Wikman
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
Markus Makela
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
Johan Wikman
f798bc9f64 Print correct default directories
Invoking 'maxscale --help' now displays the correct default
directories.
2016-09-08 14:33:21 +03:00
Johan Wikman
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
Markus Makela
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
MassimilianoPinto
07588a515d Update Replication-Proxy-Binlog-Router-Tutorial.md
Removed "servers=" in the example
2016-09-08 08:55:28 +02:00
MassimilianoPinto
4940e1482f Update Replication-Proxy-Binlog-Router-Tutorial.md
Removed "servers=" in the example
2016-09-08 08:52:14 +02:00
Johan Wikman
af896b8e86 Test modutil_get_next_MySQL_packet 2016-09-07 16:17:35 +03:00
Johan Wikman
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
Johan Wikman
5360918344 Make gwbuf_alloc_and_load const correct. 2016-09-07 12:31:26 +03:00
Johan Wikman
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
Johan Wikman
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
Markus Makela
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
Markus Makela
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
Johan Wikman
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
Johan Wikman
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
Markus Makela
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