Commit Graph

6465 Commits

Author SHA1 Message Date
47ac20adea Refer to sessions by ID instead of memory address
Using the unique ID for the session is easier to use than an address. This
also allows the removal of all pointer values from the maxadmin output
which is never useful to the end user.
2016-12-22 17:55:05 +02:00
2bdda586f7 Remove CLI service modes
The modes weren't used and provided access to raw memory which is not
safe.
2016-12-22 17:55:05 +02:00
7cbd62db52 Fix show dbusers
The functionality was broken by the change where the users were moved from
the service to the listener.
2016-12-22 17:55:05 +02:00
d50e25b688 Merge branch 'develop-2.0-merge-dec22' into develop 2016-12-22 17:54:45 +02:00
91dd2d9fb8 Cache: Plug a leak
In case the stale item must be refreshed, the stale value must be
freed as it will not be sent to the client.
2016-12-22 17:27:32 +02:00
bc496e94bb Cache: Remove break when converting switch to if 2016-12-22 17:27:32 +02:00
520d28b27d Merge branch '2.0' into develop 2016-12-22 13:40:16 +02:00
cb73263b93 MaxRows: EOF/OK is not checked while receiving a large packet
EOF / OK packet is not being checked while receiving a large packet.
If so no extra data inspection will be done.
2016-12-22 12:28:23 +01: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
97fcb94daa Cache: Always return staleness
In order for the LRU storage to correctly track the state in the
real storage, we always need to know stale-state of a returned
(or not returned) value.

The return type is now not an a pure enumeration, but a 16-bit
enumeration plus a 16-bit bitmask that can be used for conveying
more information.
2016-12-22 12:09:46 +02:00
2ea436a5c7 Cache: Test TTL behaviour 2016-12-22 12:09:46 +02:00
69acb8b9aa Cache: Fix review issues 2016-12-22 12:09:46 +02:00
e90f0d31a6 Cache: Pass argument as reference when it must be non-NULL 2016-12-22 12:09:46 +02:00
3f2c6d844b Cache: Use consistent naming in storage imlementations
- CamelCase for all C++ class and template names
- snake_case for all variables, including member variables and
  member functions
  - Static member functions start with a capital letter
- Member variables prefixed with m_
- Static member variables prefixed with s_
- Null terminated character string variables prefixed with z
- Pointers prefixed with p
- Smart-pointers prefixed with s
- Where a z, p, or s prefix is present, the following letter is
  capitalized, i.e., pEntry and not pentry.
2016-12-22 12:09:46 +02:00
3967a0b8c2 Cache: Provide Storage boiler-plate using template
All storage modules must implement the same interface and use the
same exception guards. Consequently that is conveniently provided
using a template.
2016-12-22 12:09:46 +02:00
ee422fd3ec Cache: Provide storage config as an object
Now all storage configuration values are provided in a single object.
That way it'll be easier to provide more if necessary and also makes
it straightforward to fetch the configuration, which makes it possible,
for instance, to adapt tests according to the way the storage has been
configured.
2016-12-22 12:09:46 +02:00
34b3f5c06e Cache: Invert test for capabilities 2016-12-22 12:09:46 +02:00
ae49e0e580 Add custom usage for CDC schema generator
The usage prints the required arguments and describes what this tool is
intended for.
2016-12-22 10:03:30 +02:00
06d362765c Use pending status only with running monitors
If a monitor is stopped, it is OK to modify the state of the server
without putting it into the pending status variable.
2016-12-22 10:03:30 +02:00
6da835ee44 MXS-1068: Maxrows filter doesn't count properly the result rows with size greater than16MBytes
16MBytes packets are now handled in MULTI result sets as well.
MAXROWS_DISCARDING_RESPONSE state has been removed.
Two new flags control large packets and result discarding
2016-12-21 10:06:59 +01:00
5d1b94de88 assigns the target server before gwbuf_append() 2016-12-20 13:04:01 +02:00
cc2ce089c6 little fix in tpmfilter documentation. 2016-12-20 13:04:01 +02:00
65b6ba6b1e added a comment explaining log format. 2016-12-20 13:04:01 +02:00
3e6cbeff19 1. Applied changes suggested from Markus.
2. tpmfilter now prints username of the client instead of the hostname
of the target server.
2016-12-20 13:04:01 +02:00
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