Commit Graph

6491 Commits

Author SHA1 Message Date
b0d507bf4c updated documentation for TPM filter. 2016-12-20 13:04:01 +02:00
2866ef8dae added default values for options. 2016-12-20 13:04:01 +02:00
7776d55963 tpmfilter now prints which server the query has been executed on. 2016-12-20 13:04:01 +02:00
cb243f47a0 Remove usage of LUA_OK
LUA_OK is not defined in Lua 5.1.
2016-12-20 12:40:26 +02:00
036a6de0f1 Cache: Add more storage tests
- Check LRU behaviour
- Limit both by count and size
2016-12-20 10:06:54 +02:00
ec12786f49 Cache: Do not update head when accessing tail
Accessing the tail is only for debugging purposes, so it should not
cause the head item to change.
2016-12-20 10:01:29 +02:00
68965639d2 Document zero weightby values
The behavior when a server had a zero value for the weighting parameter
was not documented.
2016-12-20 02:32:48 +02:00
ae8c21929f Serialize server weighting parameters
The server weighting parameters couldn't be altered online and they
weren't serialized to disk. Only servers that are created online will have
their weighting parameters persisted to disk.
2016-12-19 18:40:14 +02:00
180728dde6 Only serialize created servers
Any changes to servers that aren't created online need to be manually
added to the configuration file in order for them to take effect after the
restart.
2016-12-19 18:40:14 +02:00
aae84144ea Add show version command to maxadmin
After upgrades, it is usually useful to see which version of MaxScale is
running. By adding a command, we can see the actual version of the running
daemon process instead of the version of the current binary.
2016-12-19 18:40:14 +02:00
28f828b8a7 Fix luafilter build failure
Lua 5.1 doesn't return the type of the global variable so it has to be
ignored.
2016-12-19 18:40:14 +02:00
31b9018650 MXS-838 Stop readconnroute from routing to servers in maintenance
The routeQuery() in readconnroute now checks for maintenance mode. If
the server is in maintenance, the session is closed, since this router
has no backend swapping capability.
2016-12-19 15:30:15 +02:00
b62db91ab3 Add gwbuf_compare
With gwbuf_compare the content of two GWBUFs can be compared.
2016-12-19 14:55:44 +02:00
3a3632e75e Cache: Test LRU size limit 2016-12-19 11:46:56 +02:00
83c19c0b1a Cache: Factor out commonality of test[raw|lru]storage.cc 2016-12-19 11:46:56 +02:00
9998f60493 Cache: Specify item count explcitly in tests 2016-12-19 11:46:56 +02:00
43c694020c Cache: Use Tester facilities in testkeygeneration 2016-12-19 11:46:56 +02:00
23556cdfa2 Cache: Allow number of items + sizes to be specified in tests 2016-12-19 11:46:56 +02:00
f929932fc0 Move docs from buffer.c to buffer.h
- Move docs from buffer.c to buffer.h
- Arguments made const-correct.
      gwbuf_length
      gwbuf_count
      gwbuf_copy_data
- Boolean return values changes from int to bool.
      gwbuf_add_property
- Meaningless returnvalue changed from int to void.
      gwbuf_add_hint
- Unused function removed.
      gwbuf_clone_transform
      gwbuf_trim
2016-12-19 11:42:02 +02:00
6e6a3e4626 Replace gwbuf_clone_all with gwbuf_clone
gwbuf_clone cloned only the first buffer of a chain of buffers,
which never can be the desired outcome, while gwbuf_clone_all
cloned all buffers.

Now, gwbuf_clone behaves the way gwbuf_clone_all used to behave
and gwbuf_clone_all has been removed.
2016-12-19 11:00:47 +02:00
7a08ea99af Change README to Markdown and fix Travis for 2.0
Converting the README into Markdown format makes it a lot easier to
comprehent. Also cleaned up the formatting.

The 2.0 branch had a broken Travis configuration. Fixed it and changed
links to point to 2.0 branch.
2016-12-19 10:55:28 +02:00
875766cf62 Make modutil_create_query parameters const
The parameters to modutil_create_query are not modified so they can be
declared const.
2016-12-19 10:33:55 +02:00
cfaf03de3c Avoid calling nil Lua functions
If a global Lua variable is not a function, it should not be called.

Also cleaned up parts of the code and fixed a minor error reporting bug.
2016-12-19 10:33:55 +02:00
be1b868938 Expose the query classifier through the luafilter
The luafilter exposes two of the main functions provided by the query
classifier API; the type and operation classification.

The functions can be used by the Lua script with minimal overhead as the
current query being executed is stored only as a pointer. The functions
should only be called inside the `routeQuery` entry point of a Lua script.
2016-12-19 10:33:55 +02:00
8562a5138c Remove DECIMAL from avrorouter limitations
The router can now handle DECIMAL types.
2016-12-19 10:33:55 +02:00
3509aa144c Fix disable_master_role_setting in galeramon
The functionality to disable setting of master and slave status values to
Galera nodes was broken by the change to the monitoring algorithm.

The disable_master_role_setting option removed the master node which would
trigger the clearing of the replication status values from the node. A
more direct, and arguably better, way is to check that this option is
disabled before processing the status values for the nodes.
2016-12-19 10:33:55 +02:00
269a97b2de Fix DECIMAL handling in Avrorouter
The DECIMAL value type is now properly handled in Avrorouter. It is
processed into an Avro double value when before it was ignored and
replaced with a zero integer.
2016-12-19 10:33:55 +02:00
488a9d24e3 Stop the Avrorouter when MaxScale is shutting down
This allows for a faster controlled shutdown when binary log files are
being indexed.
2016-12-19 10:33:55 +02:00
7e9db7ed0c Have server status updates applied during monitor loop
Previously, server status changes from MaxAdmin would be set immediately
as long as the server lock could be acquired. This meant that it might take
several seconds until the next monitor pass is executed. Usually, this was
fine but in some situations we would want the monitor to run immediately
after the change (MXS-740 and Galera). This patch changes the logic of
setting and clearing status bits to a delayed mode: changes are first applied
to a "status_pending"-variable, and only once the monitor runs will the
setting be applied. To reduce the delay, the monitor now has a flag
which is checked during sleep (between short 0.1s naps). If set, the
sleep is cut short.

If a server is not monitored, the status bits are set directly.

There is a small possibility of a race condition: If a monitor is stopped or
destroyed before the pending change is applied, the change is forgotten.
2016-12-19 10:19:23 +02:00
ac36f04f93 Add 'root_node_as_master' to list of monitor parameters
The configuration processing requires that all parameters for monitors
exist before they are used. This is wrong if we are aiming for a modular
system but is a necessary evil for the time being.
2016-12-17 00:17:49 +02:00
2b5ec8f162 Pick node with index of 0 as the Galera master
When a Galera cluster loses a member, it will recalculate the
wsrep_local_index values. As the index is zero-based, we can be certain
that in a valid cluster there will always be a node with an index of 0.

If the galeramon can't find a node with an index of 0, it means that
either the cluster hasn't stabilized and there's a pending recalculation
of the index or that there's no connectivity between MaxScale and the node
with the index value 0.

With this change and default settings, active-active MaxScale setups with
Galera clusters should always choose the same node as the master.
2016-12-16 20:04:15 +02:00
067d48ddc6 Check if source and destination overlap in serverAddMonUser
The source and destination strings for snprintf must not overlap. A simple
check for the address of the source and destination should solve the case
where they are the same. Behavior is undefined if the pointers aren't the
same but the memory overlaps.
2016-12-16 18:18:04 +02:00
f69c8ccd0c Use server credentials for monitor permissions checks
When the monitor performs permission checks, it should use the `monuser`
and `monpw` credentials if they are defined.
2016-12-16 18:02:07 +02:00
9e27e6c002 Don't ask for unlimited files
There's a bug reported on Launchpad
(https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1420640) that
describes a similar situation. The solution is to request a lower limit of
open files for the process.
2016-12-16 15:51:17 +02:00
d457f9cd03 Cache: Add LRU storage test
Just initial tests; to be expanded.
2016-12-16 12:50:30 +02:00
7a7cfbab36 Cache: Refactor Tester hierarchy
Now that the cache key can be generated using the StorageFactory
there is no need for calling back into the derived class from Tester
to get hold of one. Instead the preparatory work is performed by
the abstract base classes, then the control is moved back to the
derived concrete class that decides what to actually do.
2016-12-16 12:42:45 +02:00
883b82a26a Cache: Use StorageFactory for creating the cache key
Now the preparatory work is done using the storage factory and the
storage instance is created only when the actual testing is performed.
2016-12-16 12:42:45 +02:00
9e89fe9246 Cache: Move key generation to module level
The key generation is dependent upon the storage implemenation,
but not on a particular storage instance.
2016-12-16 12:42:45 +02:00
297b8e1a44 Cache: Implement testrawstorage using TesterRawStorage 2016-12-16 12:42:45 +02:00
80ac69d667 Cache: Add TesterRawStorage class
A class dedicated for performing tests for raw storages.
2016-12-16 12:42:45 +02:00
eda84a1f96 Cache: Add TesterStorage class
A class dedicated for performing basic testing of Storages.
2016-12-16 12:42:45 +02:00
179762ff0a Cache: Add Tester class
A Tester class that simplifies the creation of various cache tests.
It provides the basic mechanisms for reading statements from MySQL/
MariaDB test files, for converting statements into equivalent
cache items (key + statement) and for running various tasks in
separate threads for a specific amount of time.
2016-12-16 12:42:45 +02:00
2751640a02 Adjust for RocksDB behaviour
RocksDB returns success when deleting a non-existing key. To deal
with that the book-keeping of LRUStorage is used and the real
underlying storage is used only if LRUStorage thinks a particular
key exists.
2016-12-16 12:42:45 +02:00
bb9b5a87c1 Log a message when persisted configurations are used
If no message is logged, it will be very hard to figure out where some
configurations are coming from. For this reason, it's good to log a
message whenever a persistent configuration change is taken into use.
2016-12-16 10:28:06 +02:00
11d1875399 Handle batched reads from cloned sessions
Readwritesplit should route all queries from cloned sessions to the
master. This allows batch statements to be safely routed.

Native readwritesplit sessions only support batched writes as batched
reads aren't very common. Once readwritesplit supports batched reads, the
special handling for cloned DCBs can be removed.
2016-12-16 10:27:56 +02:00
4d431b787a Remove rwsplit transaction tracking
The transaction tracking is done by the client protocol so readwritesplit
doesn't need to do it.
2016-12-16 10:27:56 +02:00
7454ef1d0b MXS-1064: Encryption options to "show service ..."
The binlog encryption options are reported by “show service
$service_name” of binlog router if the encryption is enabled.
2016-12-16 08:48:36 +01:00
3a96482c23 Remove unnecessary memory barrier
The memory barrier is not needed here. Declaring poll_msg as volatile
should help with preveting some unwanted optimizations. Most likely
even that is unnecessary.

This came up when testing maxadmin "show servers", which is
surprisingly slow compared to the other commands. This change does
not help because the slowness is caused by the polling loop sleeping.
In a more busy environment the command would probably complete faster.
This should be looked at later.
2016-12-15 15:54:24 +02:00
f59c6d67c3 Expand testrawstorage
Now also rudimentary tests the LRU mechanism, which at the same
time makes the name a misnomer. These will be split into separate
programs to allow tests to be run individually.
2016-12-15 10:17:39 +02:00
8019bf71e0 Honour max_size also with existing values
If an exiting value is updated and the new size would cause the
maximum size to be exceeded, we must evict items so that we stay
below the boundary.
2016-12-15 10:17:39 +02:00