5799 Commits

Author SHA1 Message Date
Johan Wikman
4a7040c308 MXS-879: Match users properly.
If account wildcards - % - are used, the string is changed
into a pcre regular expressions and compared using that.
2016-10-11 19:55:29 +03:00
Johan Wikman
69cf3cf93a Extend error message when query cannot be parsed 2016-10-11 19:55:29 +03:00
Markus Makela
2fb9e99549 Add missing license blurbs
Some file were missing the license blurb at the top of the file.
2016-10-07 09:33:17 +03:00
Markus Makela
9b2209a8d1 Log only one warning when failover is initiated
Mysqlmon would log a warning at every monitoring interval when failover
was initiated.
2016-10-06 16:53:37 +03:00
Johan Wikman
56f0edb247 Cache: Add possibility to parse rules from string
To be used in test program.
2016-10-06 14:58:42 +03:00
Markus Makela
81fa8c6c0c Assign master status immediately to the replacement master
As the failover status check is done after the pending status has been
moved to the current status, the do_failover should set the current status
of the server as Master.
2016-10-06 14:30:02 +03:00
Johan Wikman
84cadd4c45 Slightly adjust the semi-sync documentation 2016-10-05 15:58:34 +03:00
Markus Makela
e54c40ca7b Merge branch 'pull-102' into develop 2016-10-05 10:00:09 +03:00
Markus Makela
cc01ce5c16 Remove obsolete parts from testlog.c
The code used the log manager in the wrong way which caused the test to
hang from time to time.
2016-10-03 15:40:49 +03:00
Markus Makela
fbf5c331f1 Merge branch '2.0.1' into develop 2016-10-03 15:21:04 +03:00
Johan Wikman
b42231e5d4 storage_rocksdb: Clearer error when db in use 2016-09-30 12:45:02 +03:00
Johan Wikman
45073ebd73 cache: Pick out default db when connecting with database 2016-09-30 11:32:38 +03:00
Johan Wikman
91759ef323 Use MXS_ALERT when logging the stack of a crash
As MXS_ERROR is throttled you'd risk missing some part of the stack.
2016-09-30 10:48:04 +03:00
Johan Wikman
93b755fc33 Add MXS_ALERT
As errors and warnings are throttled, there is a need for being able
to log severe errors without ever having them throttled (e.g. when
logging the stack in conjunction with a crash).

MXS_ALERT should only be used in a context where the process is known
to be going down, either via crash or explicit exit.
2016-09-30 10:44:59 +03:00
Johan Wikman
fa2a667195 qc_sqlite: Handle a name like ``a. 2016-09-29 23:48:21 +03:00
Johan Wikman
ca76cb1576 qc_sqlite: Recognize backslash as escape character
Without this change, e.g.

    insert into t1 values('\'');

causes a buffer overflow and crash.
2016-09-29 22:50:18 +03:00
Markus Makela
4658a28965 Fix out of bounds read in avro_client_process_command
When the last transaction was queried, it caused an out of bounds read
when strstr was used on the raw data of a GWBUF.
2016-09-29 15:28:57 +03:00
Markus Makela
dcf55d4099 Fix possible out of bounds read in CDCPlainAuth
When the authentication string was decoded from hexadecimal to binary, it
was possible that an out of bounds read was done if the length of the data
was not an even number.
2016-09-29 14:57:44 +03:00
Johan Wikman
087338910e storage_rocksdb: Store version to database
The storage_rocksdb version is now stored to the database. That will
ensure that should the format (key content, length, etc.) change, we
can will detect whether a database is too old and take action.
2016-09-29 14:06:23 +03:00
Johan Wikman
b9c956dda9 cache: Include the databases in the key
The databases targeted by a query are now included in the key.
That way, two identical queries targeting a different default
database will not clash.
Further, it will mean that queries targeting the same databases
are stored near each other, which is good for the performance.
2016-09-29 11:28:01 +03:00
Johan Wikman
7732070546 cache: Add 'use' rules handling
Currently onyl the user name is matched, eventually it should
probably be possible to indicate the network as well, or only
the network.
2016-09-29 11:26:12 +03:00
Johan Wikman
3d5cfee348 housekeeper: Copy data to prevent access of freed data 2016-09-29 09:34:54 +03:00
Johan Wikman
0478c3cc83 cache: Add table and query matching 2016-09-28 19:38:11 +03:00
Johan Wikman
7f24f12cfc cache: Update documentation and add rule handling
The concept of 'allowed_references' was removed from the
documentation and the code. Now that COM_INIT_DB is tracked,
we will always know what the default database is and hence
we can create a cache key that distinguises between identical
queries targeting different default database (that is not
implemented yet in this change).

The rules for the cache is expressed using a JSON object.
There are two decisions to be made; when to store data to the
cache and when to use data from the cache. The latter is
obviously dependent on the former.

In this change, the 'store' handling is implemented; 'use'
handling will be in a subsequent change.
2016-09-28 19:38:11 +03:00
Johan Wikman
20b57b1577 cache: Remove default db only is use db succeeds 2016-09-28 19:38:11 +03:00
Johan Wikman
4df5431572 qc_sqlite: Reduce logging when query cannot be parsed
If a query could not be parsed and details about the query are
asked, we log an info level message instead of an error.
2016-09-28 17:49:27 +03:00
Markus Makela
fd3bbf24c8 Fix .travis.tml package names
The libuuid package names were wrong.
2016-09-28 12:04:02 +03:00
counterpoint
2ae4fb7745 Add missing comment blocks. 2016-09-28 09:33:28 +01:00
Johan Wikman
8f233d32cf Always update state of bref behind lock 2016-09-28 09:29:56 +03:00
Markus Makela
0f68b2b825 Fix Travis builds
libuuid and libuuid-dev were missing from the list of installed packages.
2016-09-27 10:06:18 +03:00
Johan Wikman
8fc6f52eea Update ChangeLog 2016-09-26 18:18:02 +03:00
Markus Makela
a927cdad1b Add new mysqlmon features to release notes
The release notes now contain entries for the multi-master and failover
modes.
2016-09-26 11:18:21 +03:00
Markus Makela
c919511ba7 Implement simple failover mode into mysqlmon
The mysqlmon simple failover mode allows it to direct write traffic to a
secondary node. This enables a very simple failover mode with MaxScale
when it is used in a two node master-slave setup.
2016-09-26 11:00:16 +03:00
Markus Makela
997fe6b90b Add a fail-safe for active operation counters
If a backend is not in use but it is waiting for a result, the state
should anyways be cleared to keep the operation counters correct.
2016-09-26 09:29:44 +03:00
Markus Makela
dd65062531 Fix broken link lists and clean up tutorials
Some of the tutorials didn't follow proper Markdown formatting rules.
2016-09-26 09:23:11 +03:00
Johan Wikman
a4aa03a1fb cache: Explicitly handle COM_INIT_DB
With this change, the cache will be aware of which default database
is being used. That will remove the need for the cache parameter
'allowed_references' and thus make the cache easier to configure
and manage.
2016-09-23 19:06:14 +03:00
Markus Makela
649efb91b5 Fix broken upgrades on CentOS 7
The upgrade process removed the /var/lib/maxscale directory as the newer
version didn't use it. This can be fixed by installing an empty directory
into /var/lib/maxscale.
2016-09-23 16:40:03 +03:00
Markus Makela
e618370cdb MXS-875: Fix regexfilter matching
The return values of pcre2_match are now properly handled. A positive
match is a return value which is greater than or equal to zero. This fix
should give a small performance boost to as memory is no longer needlessly
allocated.
2016-09-23 14:43:03 +03:00
Johan Wikman
542666ed16 qc_sqlite: Remove leak
Previously a query like e.g.

    delete t11.*, t12.* from t11,t12 where t11.a = t12.a;

would cause a leak. The code for freeing that memory was present
but commented out because it used to cause a crash.

Now no crash appears, so it would seem that the crash was caused
by something else that no longer is present.
2016-09-23 11:26:48 +03:00
Johan Wikman
ac43580ce8 cache: storage_args renamed to storage_options 2016-09-22 14:22:45 +03:00
Johan Wikman
049f823d37 Update tag information 2016-09-22 13:50:57 +03:00
Markus Makela
97858c164d Update library dependencies
Libcurl was not listed in the list of required packages.

The tarball installation instruction did not list any of the required
libraries.
2016-09-22 12:38:58 +03:00
Markus Makela
e484aac6f0 Use CLOCK_MONOTONIC instead of CLOCK_MONOTONIC_RAW
The CLOCK_MONOTONIC_RAW isn't supported on all of the platforms, namely
CentOS 5.
2016-09-22 10:09:25 +03:00
Markus Makela
0a951d5e65 Merge branch 'develop-2.0-merge' into develop 2016-09-22 09:49:10 +03:00
Markus Makela
eaf43ca92d Merge branch '2.0' into develop-2.0-merge 2016-09-21 14:59:30 +03:00
Johan Wikman
a8118b98b4 Further refine the tarball instructions 2016-09-21 14:26:15 +03:00
Markus Makela
0882541c80 Make the default directories configurable
The default directories can now be changed at build time. This allows
tarballs to look for libraries in a more sensible place.
2016-09-21 14:21:18 +03:00
Johan Wikman
4422cd87eb Update tarball installation instructions
The /var/[log|lib|run|cache]/maxscale directory must be created
manually.
2016-09-21 13:07:13 +03:00
Markus Makela
578f21e757 MXS-874: Clear closed state before reconnecting to a server
The backend reference states should be cleared when a reconnection attempt
is made. Should the creation of a new DCB succeed, the backend should no
longer be closed.
2016-09-21 11:15:57 +03:00
Markus Makela
bd60fbde7e Create dummy files in /var directories for tar.gz packages
These files allow seemingly empty directories to be installed on various
platforms. Some platforms had problems installing empty directories.
2016-09-21 11:11:24 +03:00