Commit Graph

32 Commits

Author SHA1 Message Date
695ba19965 Massimiliano pinto doc update 2.1 (#125)
* Update Nagios-Plugins.md

* Update MM-Monitor.md

* Update Nagios-Plugins.md

* Update Nagios-Plugins.md

* Update Galera-Cluster-Connection-Routing-Tutorial.md

* Update Galera-Cluster-Connection-Routing-Tutorial.md

* Update RabbitMQ-Setup-And-MaxScale-Integration.md

* Update MaxScale-Tutorial.md

* Update Cache.md

* Update Transaction-Performance-Monitoring-Filter.md

* Update RabbitMQ-Consumer-Client.md

* Update Building-MaxScale-from-Source-Code.md

* Update MariaDB-MaxScale-Installation-Guide.md

* Update Install-MariaDB-MaxScale-Using-a-Tarball.md

* Update RabbitMQ-Setup-And-MaxScale-Integration.md

* Update RabbitMQ-Consumer-Client.md
2017-04-20 13:36:13 +02:00
33b809eec1 Do not build storage_rocksdb by default 2017-04-20 13:12:46 +03:00
441b0204bf Update cache documentation 2017-03-22 11:04:48 +02:00
df09dd2043 Update Cache documentation 2017-03-21 10:35:30 +02:00
0393943b0e Update Cache documentation 2017-03-17 14:12:51 +02:00
ed06b6a331 The cache storage storage_inmemory is now the default 2017-03-17 13:45:55 +02:00
6db3cc380b Add cache parameter 'selects' 2017-03-17 09:06:27 +02:00
da5edadcda MXS-1150: Do not cache non-cachable functions
The resultset of SELECTs that use functions whose result will
always vary or whose result depend upon the user executing the
query should not be cached. The list of functions is the same
as that specified for the query cache of MariaDB:
https://mariadb.com/kb/en/mariadb/query-cache/
2017-03-02 13:13:31 +02:00
4902ed7cf5 MXS-1137: Do not cache when [user|system] vars are used
If user or system variables are used in a SELECT statement, then
the result will not be cached. That ensures that the wrong result
will not be returned.
2017-03-02 12:35:53 +02:00
82049b8ed1 Use cache as long as a trx only performes reads
As before, the cache will be used if there is no ongoing transaction
(includes autocommit being on), or if there is an explicitly read-
only transaction.

In addition, the cache will be used and populated during any other
transaction as long as only pure read statements are executed. After
first non-read statement, the use of the cache is disabled.
2017-03-01 11:08:52 +02:00
ac0679a9d5 Update filter documentation
- Add note about filters having become available in 2.1.
- Add insertstream to release notes and change log.
- Add complete example to cache documentation.
2017-02-09 15:02:34 +02:00
d8e05436b1 Update Cache documentation 2017-02-03 12:43:44 +02:00
49bb63810e Cache: Add limitation 2017-01-31 08:30:11 +02:00
eb05132a5c Cache: Use MXS_MODULE_PARAM_SIZE 2017-01-23 11:01:57 +02:00
d012f137c6 Update cache documentation 2017-01-20 14:02:32 +02:00
c7dfd1b0bd Cache: Introduce soft and hard TTL
- Hard TTL; the maximum time a value will be used from the cache.
- Soft TLL; the time after which the cache value should be updated
  from the server.

So as not to unnecessarily fetch the same value multiple times, when
the soft TTL has been reached, the value will be updated for the first
client, while all other clients will use the stale value until it has
become updated.

With different soft and hard TTLs there is a definite upper bound for
how old a value can be used.
2016-12-22 12:09:46 +02:00
423b54ef82 Cache: 0 is now default of integer parameters
0 is now the default of all cache configuration parameters and in
all cases the meaning is the same; that is, no limit. Internally
all limits but ttl are now for the sake of consistency 64-bit.
2016-12-13 12:37:28 +02:00
fab7accef3 Cache: Collect RocksDB statistics 2016-12-08 14:58:59 +02:00
30074b7960 Cache: Add storage_inmemory documentation
Mostly a place-holder at the moment.
2016-12-08 14:58:59 +02:00
b87ea735fb Cache: Correct examples in documentation 2016-11-30 10:22:53 +02:00
9c1b9c188e Cache: Enable LRU eviction
The maximum count and maximum size of the cache can now be
specified and a storage can declare what capabilities it has.
If a storage modile cannot enforce the maximum count or maximum
size limits, the storage is decorated with an LRU storage that
can.
2016-11-30 10:22:53 +02:00
a2daacd465 Cache: Add options for choose sharing mode
Now possible to use same cache for all threads or separate cache
for each.
2016-11-29 11:23:23 +02:00
97b039689f Disable write-ahead log
Since it's a cache, we do not need to retain the data from one
MaxScale invocation to the next. Consequently, we can turn off
write ahead logging completely if we simply wipe the RocksDB
database at each startup. In addition, the location of the
cache directory can now be specified explicitly, so it can be
placed, for instance, on a RAM disk.
2016-11-22 08:44:00 +02:00
c4999232ce MXS-935: Implement column matching
With the advent of qc_get_field_info, columns can now be matched.
However, there is still some undeterminism caused by the table
information not containing contextual information (exactly where
is the table used).

Further, suppose table X contains the column A and table Y contains
the column B, then given a statement like

    SELECT a, b from X, Z;

we cannot know whether a is in X or Z, or b in X or Z, without being
aware of the schema, which we currently are not.

Consequently, as long as MaxScale is not aware of the schema, some
heuristics must be applied. For instance, if exactly one table is
referred to, then we can assume that columns that are not explicitly
qualified are from that table.

The rule tests are currently rather rudimentary and need to be
expanded.
2016-11-16 10:44:56 +02:00
199dd51312 Cache: C_DEBUG removed and debug option extended
The development time C_DEBUG is now removed, and replaced with
a debug option that allows top-level decisions to be logged.
2016-10-27 11:10:36 +03:00
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
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
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
ac43580ce8 cache: storage_args renamed to storage_options 2016-09-22 14:22:45 +03:00
4d1eb6fe85 cache: Process response to COM_QUERY
When a query has been sent to a backend, the response is now
processed to the extent that the cache is capable of figuring
out how many rows are being returned, so that the cache setting
`max_resultset_rows` can be processed.

The code is now also written in such a manner that it should be
insensitive to how a package has been split up into a chain of
GWBUFs.
2016-09-20 10:41:02 +03:00
8a12bd6487 Implement parameter handling for cache 2016-09-14 14:11:27 +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