7034 Commits

Author SHA1 Message Date
Johan Wikman
a1d1413b24 Add atomic_add for 64-bit integers.
Now only GCC intrinsics are used.
2017-03-30 12:36:23 +03:00
Markus Mäkelä
b458b63756 Use IPv6 for created listeners
When listeners are created, use the default values of [::]:3306.
2017-03-29 17:14:39 +03:00
Markus Mäkelä
1901a3bc0a Bind to IPv6 addresses by default
The `::` address covers both IPv4 and IPv6 addresses allowing both IP
versions to be used by default.
2017-03-28 21:25:30 +03:00
Johan Wikman
4b2d94d0f8 When a transaction has been started, no other checks are needed
If we do check then we will end up turning off the read only flag
that just was set on.
2017-03-28 16:17:13 +03:00
Markus Mäkelä
f2734f895e Revert "Update dbfwfilter build configuration"
This reverts commit 09ef292283311483354e6cd628318a5cafd96b2c. The old
syntax is still required on SLES 11.
2017-03-27 10:01:54 +03:00
Johan Wikman
27d81cda6a Merge branch '2.1.1' into 2.1 2017-03-22 13:06:41 +02:00
Johan Wikman
2d00fe1019 Remove references to old release notes 2017-03-22 13:02:18 +02:00
Johan Wikman
d70dad260a Implement collecting behaviour in qc_sqlite
By default, only the essentials - the type and the operation - of
a statement will be collected and only if fields, tables, functions
and databases are explicitly asked for, will they be collected.
However, a statement will be parsed at most twice; if parsing is
needed a second time then all information will be collected.

If it is known that some particular information is needed, then
qc_parse() can be called explicitly to ensure it is collected
at first parsing.
2017-03-22 11:09:36 +02:00
Johan Wikman
d0a9571da0 Introduce new qc_parse() prototype
It is now possible to specify what information the caller is interested
in. With this the cost for collecting information during the query parsing
that nobody is interested in can be avoided.
2017-03-22 11:09:36 +02:00
Johan Wikman
441b0204bf Update cache documentation 2017-03-22 11:04:48 +02:00
Johan Wikman
15a22ec295 Do not use shared PCRE2 match data
The match data needs to be unique for each thread, so for the time
being it is created whenever it is needed. A more performant (although
possibly to a negigible amount) solution would be to have a separate
match data for each thread, but that will have to wait for 2.2.
2017-03-21 15:21:13 +02:00
Johan Wikman
117534d288 Use JIT in regex matching if available 2017-03-21 15:21:13 +02:00
Johan Wikman
17057ef340 Use thread specific pcre2 match data
For 2.2 a worker/thread object need to be passed around so that
not everyone need to create their own thread id mechanism.
2017-03-21 15:21:13 +02:00
Johan Wikman
3670edbc78 Spinlock cleanup
- Non-GCC intrinsics alternative implementation removed. Let's worry
  about the absence of the intrinsics once/if that becomes relevant.
- Spinlock release now performed using __sync_lock_release, as per
  svoj's advice.
- while-looping on the variable used as lock removed, so it no longer
  need to be volatile.
- Boolean function returns bool.
- Size of profiling counters increased.
- Risk for division-by-zero removed.
- Documentation moved from implementation to header.
2017-03-21 15:19:10 +02:00
Johan Wikman
4ca3c19ee3 Use [true|false] instead of [TRUE|FALSE] 2017-03-21 15:17:44 +02:00
Markus Mäkelä
83d696cdde Enable JIT support for PCRE2
The bundled PCRE2 library was built without JIT support.
2017-03-21 13:12:54 +02:00
Johan Wikman
b81c86f228 A rules object may be empty 2017-03-21 10:35:30 +02:00
Johan Wikman
df09dd2043 Update Cache documentation 2017-03-21 10:35:30 +02:00
Markus Mäkelä
ff60500d06 Document router module object
The router module object is now documented with similar documentation to
that of the filter module object.
2017-03-20 12:22:57 +02:00
Markus Mäkelä
ab4c738c3c MXS-1167: Skip loading of users for internal services at startup
When MaxScale is being started and the users are loaded, the MySQL
authenticator should not load the database users for internal services
abstracted as servers.

The loading of users at startup for internal services is avoided because
the startup is done in a single thread context and the internal services
have not yet been started.

The delayed loading of users will cause the authentication to fail when
the first client connect. This triggers the reloading of the users and the
second attempt at authentication will succeed. All of this is hidden from
the end user.
2017-03-20 12:16:29 +02:00
Markus Mäkelä
0b5d164855 MXS-1167: Skip permission checks for internal services
If a server points to a local MaxScale listener, the permission checks for
that server are skipped. This allows permission checks to be used with a
mix of external servers and internal services.
2017-03-20 11:10:55 +02:00
Markus Mäkelä
2e6e8574a4 MXS-864: Document build problems with PCRE2
Added a note about PCRE2 and possible problems that occur when CMake is
configured multiple times.
2017-03-20 11:10:55 +02:00
Markus Mäkelä
a19c0ed1f3 Log executed maxadmin commands on info log level
When maxadmin commands are executed, they are logged at the info
level. This should help when the admin interface is being debugged.
2017-03-20 11:10:55 +02:00
Johan Wikman
a500bd4d79 Merge branch '2.1.1' into 2.1 2017-03-20 09:47:40 +02:00
Johan Wikman
6868c87598 Remove all but 2.1 release notes from 2.1 branch 2017-03-20 09:45:13 +02:00
Johan Wikman
f350b58509 Remove all but 2.0 release notes from 2.0 branch 2017-03-20 09:44:08 +02:00
Johan Wikman
0393943b0e Update Cache documentation 2017-03-17 14:12:51 +02:00
Johan Wikman
ed06b6a331 The cache storage storage_inmemory is now the default 2017-03-17 13:45:55 +02:00
Johan Wikman
1b418b517c Custom parsing for trx state is now the default
The possibility for turning on query_classifier parsing using
an environment variable is retained as a backdoor for sorting
out potential issues.
2017-03-17 12:30:20 +02:00
Johan Wikman
9c3aaddda1 Improve cache performance
- Selects are picked out using custom parsing, so if a statement is
  anything else but a SELECT, the cache will never cause the statement
  to be parsed.
- The setting of of the cache parameter `selects` is taken into account.
  If it is `assume_cacheable` then the statement will also not be parsed
  even if it is a SELECT.
2017-03-17 12:22:00 +02:00
Johan Wikman
b52cc4e56b Take modutil_MySQL_bypass_whitespace into use 2017-03-17 11:54:00 +02:00
Johan Wikman
7469c5be52 Add functionality for bypassing MySQL whitespace/comments
This functionality is needed both in the query classifier, where
it was first created, and in the cache.
2017-03-17 10:27:16 +02:00
Johan Wikman
6db3cc380b Add cache parameter 'selects' 2017-03-17 09:06:27 +02:00
Johan Wikman
987a52b398 Further simplify key generation
The original approach was made for RocksDB where it is beneficial
to keep keys of stuff related to each other close to each other.
However, as RocksDB is no longer the primary focus, it just causes
additional cost to dig out the table names.

The key is a 64-bit integer, but crc32 only gives us a 32-bit one.
We create an other 32-bit value by running crc32 over the same SQL,
using the first crc value as adler.

I think that further reduces the chance for clashes:

    uint32_t crc0 = crc32(0, Z_NULL, 0);
    uint32_t crc1;
    uint32_t crc2;

    crc1 = crc32(crc0, "codding", 7) => 1774765869
    crc2 = crc32(crc1, "codding", 7) => 1409592046

    crc1 = crc32(crc0, "gnu", 3)     => 1774765869
    crc2 = crc32(crc1, "gnu", 3)     => 1213798908

Note that the first value is the same, but the second is not.
2017-03-16 18:39:10 +02:00
Johan Wikman
daf3774329 Use simpler function for calculating hash
Now the key is a 64-bit integer and it is created by the cache
component and can not be unique for the storage.
2017-03-16 16:47:15 +02:00
Markus Mäkelä
f384050d45 Assign stale master status to standalone masters
When a standalone master server is detected, it should receive the stale
status to prevent it from losing the master status if another server is
started and allow_cluster_recovery is enabled.
2017-03-15 17:37:25 +02:00
Markus Mäkelä
3396741c21 Improve UTF-8 handling in avrorouter
The json_stringn function should be used instead of the json_string to
allow null characters as well as non-null terminated strings to be
embedded in the JSON values.

The CDC example Python programs now decode the data as UTF-8 instead of
ASCII.
2017-03-15 17:37:25 +02:00
Markus Mäkelä
67590d59ac Fix connector_plugindir usage with basedir
The connector_plugindir wasn't set correctly when basedir was used.
2017-03-15 17:37:25 +02:00
Markus Mäkelä
c4d08a6936 Update build dependencies and documentation
The libaio is not required by MaxScale so the check for it is no longer
needed.

Updated documentation to match the current requirements to build MaxScale.
2017-03-15 17:37:25 +02:00
Johan Wikman
5e39268e37 Remove support for TrxBoundaryMatcher
For the general case, regex matching simply will not do. The
regex becomes so hairy so it turns write-only, i.e. unmaintainable.
Regex matching is also slower than a handwritten custom parser.
2017-03-15 10:39:26 +02:00
Johan Wikman
c235e181ce Null filter no long requires 'capabilities' argument
- If no capabilities are provided, then the filter will have none.
- Now logs its capabilities as startup (useful for debugging).
2017-03-15 10:26:31 +02:00
Johan Wikman
1c8205e005 Add missing flag handling 2017-03-15 10:25:02 +02:00
Johan Wikman
c51cd8858d Minor optimizations to TrxBoundaryParser 2017-03-15 10:20:35 +02:00
Johan Wikman
96f0321b7e Add program for profiling TrxBoundaryParser 2017-03-15 09:35:15 +02:00
Johan Wikman
9a33cf4d3e Add smoke-test for qc_get_trx_type_mask_using
Use the query classifier test files and compare that the
result returned by qc_sqlite and the custom parser agree
for every statement.
2017-03-15 09:35:15 +02:00
Johan Wikman
cab176b149 Fix handling of AUTOCOMMIT=ON 2017-03-15 09:35:15 +02:00
Johan Wikman
87d84bc81c Ignore implicit commits 2017-03-15 09:35:15 +02:00
Johan Wikman
c2add97e30 Recognise various autocommit syntaxes
set autocommit=1
set global autocommit=1
set session autocommit=1
set @@global.autocommit=1
set @@session.autocommit=1
2017-03-15 09:35:15 +02:00
Johan Wikman
470de51e22 Handle whitespace in TrxBoundaryParser
TheBoundaryMatcher is not updated as it is likely it will be removed
altogether. A regex that accepts comments in all relevant places becomes
so hairy it is unmaintainable. It seems that the only working solution
would be to first remove all comments and then perform the regex.
2017-03-15 09:35:15 +02:00
Johan Wikman
931f765df5 Enhance transaction tracking test 2017-03-15 09:35:15 +02:00