Commit Graph

5794 Commits

Author SHA1 Message Date
715f978051 Add TARBALL variable to CMake
The TARBALL variable controls if a special tar.gz package is built when
packages are generated. This package has a different directory structure
compared to the RPM/DEB packages.

If RPM/DEB packages are built, tar.gz packages are not built. This makes
RPM/DEB generation faster and allows tarballs to be built separately with
a proper directory structures.
2016-09-20 16:32:21 +03:00
1331bf9ae8 Add CPACK_PACKAGE_FILE_NAME to CMake cache
Adding CPACK_PACKAGE_FILE_NAME to the CMake cache allows the user to
control it. With this, custom tarball names can be easily generated.
2016-09-20 16:32:21 +03:00
dfec3c8552 Install maxbinlogcheck in the right place
Maxbinlogcheck was installed in the wrong place.
2016-09-20 16:32:21 +03:00
0f6d4e4cdb Fix typo in tarball documentation 2016-09-20 13:58:28 +03:00
923761159f Move MXS-807 refactor read-write split into develop. 2016-09-20 11:55:02 +01:00
6ec999851f Update 2.0.1 release notes 2016-09-20 13:00:39 +03:00
9a9511fc58 Update tarball instructions 2016-09-20 12:46:43 +03:00
3992135325 Move authentication return codes to gw_authenticator.h
The MYSQL_* authentication return codes are now in gw_authenticator.h so
that all authenticators can use them. Also dropped the MYSQL_ prefix from
the return codes and added AUTH_INCOMPLETE for a generic
authentication-in-progress return code.
2016-09-20 11:44:17 +03:00
b1b2e5b770 Don't free the shared shard maps
When client sessions are closed, the shared shard maps should not be freed.
2016-09-20 11:33:09 +03:00
0ab4f04d7b Add authentication plugin name to authenticator API
The authenticators can now declare the authentication plugin name. Right
now this is only relevant for MySQL authentication but for example the
HTTP module could implement both Basic and Digest authentication.
2016-09-20 11:31:13 +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
7e2a21de9e Cache: Assume we need to handle one packet at a time 2016-09-20 10:41:02 +03:00
1001654987 Add utility scripts to make installation easier
The `create_grants` scripts allow users to be easily "copied" to
MaxScale. It queries the backend for grants for all users and converts
them into similar grants for the MaxScale host.

The `create_roles.sql` is a small set of queries which creates two utility
roles, `proxy_authenticator` and `proxy_monitor`. These roles can be
assigned to the actual service and monitor users with a single grant
command.
2016-09-20 10:30:53 +03:00
35d4be14d2 Make service and monitor permissions checks optional
MaxScale shouldn't require the service and monitor user checks. It makes
sense to disable the checks to speed up the startup process when the user
knows that the permissions are OK.
2016-09-20 10:30:53 +03:00
e4543881d2 Add instructions for installing a package 2016-09-20 10:14:26 +03:00
60955ba70d Clean up mysqlmon after pull request merge
The pull request introduced some minor whitespace errors.
2016-09-20 09:23:58 +03:00
e849297fc8 line length now less than 110 characters 2016-09-20 09:23:58 +03:00
48456833da fixed memleak and potential call of mysql_num_rows with NULL 2016-09-20 09:23:58 +03:00
73c974c286 Remove automatic create database - requires too powerful database user. 2016-09-20 09:23:58 +03:00
ec42413db8 Initial changes to implement test before creating maxscale_schema. 2016-09-20 09:23:57 +03:00
92ef33327e MXS-870: Handle non-contiguous session command responses
Session command responses with multiple packets could be spread across
multiple, non-contiguous buffers. If a buffer contained a complete packet
and some extra data but it wasn't contiguous, the debug assertion in
gwbuf_clone_portion would fail. With release builds, it would cause
eventual out-of-bounds memory access when the response would be sent to
the client.
2016-09-19 09:58:20 +03:00
7fc7249349 Update installation instructions 2016-09-16 12:25:29 +03:00
89f9f4a42f Lock writeq before inspecting it
Looking at the contents of the writeq should be done under a spinlock
otherwise it is possible that another thread grabs the queue.
2016-09-16 10:05:50 +03:00
2a4addc298 Clear waiting results flag on client errors
When a backend causes an error and it should be sent to the client, the
backend reference was closed but the waiting results state was not
cleared. This caused a debug assertion to be hit.
2016-09-16 09:58:56 +03:00
7bd0b19b59 Update MaxScale version number 2016-09-15 23:13:33 +03:00
b60f000a4c Format tpmfilter
The filter is now formatted with the astyle config.
2016-09-15 12:21:54 +03:00
08d2529312 Merge branch 'develop' into pull-102 2016-09-15 10:26:53 +03:00
029e6574da MXS-812: Always reset counters when backend is closed
The active operation counters are now closed every time a backend referece
is taken out of use. This should fix a few debug assertions that were hit
in tests.
2016-09-15 08:31:15 +03:00
ff7634113b Assign Relay Master only to running servers
The Relay Master status was set for servers that were down. The check for
valid master and node IDs was missing which caused a false positive.
2016-09-15 07:13:10 +03:00
df38b4dd50 Add utility scripts to make installation easier
The `create_grants` scripts allow users to be easily "copied" to
MaxScale. It queries the backend for grants for all users and converts
them into similar grants for the MaxScale host.

The `create_roles.sql` is a small set of queries which creates two utility
roles, `proxy_authenticator` and `proxy_monitor`. These roles can be
assigned to the actual service and monitor users with a single grant
command.
2016-09-15 07:13:10 +03:00
da9c7db231 Fix Travis builds
The travis builds failed due to outdated build scripts. The queuemanager
also failed to build on non-Debug builds.
2016-09-15 07:13:10 +03:00
e01b4a33fd Make service and monitor permissions checks optional
MaxScale shouldn't require the service and monitor user checks. It makes
sense to disable the checks to speed up the startup process when the user
knows that the permissions are OK.
2016-09-15 07:13:10 +03:00
8baba28450 Cleanup modutil_get_next_MySQL_packet
- Single entry/single exit.
- Variables declared as they are needed.
- The GWBUF_EMPTY check removed as it only looks at the first buffer
  in a chain. That is, if there had been a non-empty chain where the
  first buffer is empty, the function would incorrectly have reported
  that the buffer contains no packet.
- Documentation updated.
2016-09-14 15:13:25 +03:00
4597cdf7b9 Use gwbuf_split in modutil_get_next_MySQL_packet
Earlier, a copy was made.
2016-09-14 15:13:25 +03:00
b138a43ab8 cache: 64KiB is more appropriate default than 64MiB 2016-09-14 14:39:27 +03:00
8a12bd6487 Implement parameter handling for cache 2016-09-14 14:11:27 +03:00
86909b5067 Add macro for checking buffer contiguousness
A NULL buffer is considered contiguous.
2016-09-14 13:01:34 +03:00
65ccc6b8fb CMakeLists.txt cleanup
- maxscale-common no longer linked with libaio as it is not used.
2016-09-14 11:31:01 +03:00
9790eaaf20 storage_rocksdb explicity dependent on RocksDB 2016-09-13 11:45:03 +03:00
2cb6bdcf67 Fix typo on build variable 2016-09-13 11:45:03 +03:00
293b125e12 Define namespace function using explicit scope 2016-09-13 11:45:03 +03:00
cf86b80584 Link storage_rocksdb with libraries required by RocksDB 2016-09-13 11:45:03 +03:00
7fe981c22f Cache: Handle TTL manually
The RocksDB TTL database only honours the TTL when the database
is compacted. If the database is not compacted, stale values will
be returned until the end of time.

Here we utilize the knowledge that the TTL is stored after the
actual value and use the root database for getting the value,
thereby getting access to the timestamp.

It's still worthwhile using the TTL database as that'll give
us compaction and the removal of stale items.
2016-09-13 11:45:03 +03:00
a96d215aa0 Make it possible to include internal RocksDB headers
The RocksDB storage will need to refer to some internal
RocksDB files.
2016-09-13 11:45:03 +03:00
a76c05e8db MXS-797 Add initial version of RocksDB storage
RocksDB is cloned from github and version v4.9 (latest at the time of
this writing) is checked out.

RocksDB can only be compiled as C++11, which means that RocksDB and hence
storage_rocksdb can be built only if the GCC version is >= 4.7.

The actual storage implementation is quite straightforward.

- The key is a SHA512 of the entire query. That will be changed so that
  the database/table name is stored in the beginning of the key unhashed
  as that will cause cached items from the same table to be stored
  together. Assumption is that if you access something from a particular
  table, chances are you will access something else as well.
- When the SO is loaded, the initialization function will created a
  subdirectory storage_rocksdb under the MaxScale cache directory.
- For each instance, the RocksDB cache is created into a directory
  whose name is the same as the cache filter name in the configuration
  file, under that directory.
- The storage API's get and put functions are then mapped directly on
  top of RockDB's equivalent functions.
2016-09-13 11:45:03 +03:00
0c55385525 Merge branch 'develop' of git://github.com/dongyoungy/MaxScale into pull-102
Merged and fixed merge problems.
2016-09-13 10:47:05 +03:00
82846785a7 Make modules depend on maxscale-core
All modules which are now installed automatically depend on the
maxscale-core target. This fixes concurrent builds failing due to missing
libraries.
2016-09-13 09:25:23 +03:00
6dc75d4b9c MXS-860: Detect whether replication is configured
The `detect_stale_slave` functionality used to only work when MaxScale had
the knowledge that a master server has existed and that replication was
working at some point in time. This might be a "safe" way to do it in
regards to staleness of the data but in practice it is preferrable to
always allow slave to be used for reads.

This change adds the missing functionality to the monitor by assigning
slave status to all servers which are configured as replication slaves
when no master can be found.

The new member variable that was added to the SERVER should be removed in
2.1 where the server_info offers the same functionalty without "polluting"
the SERVER type.
2016-09-12 15:59:08 +03:00
36e243e07d Refactor monitor_mysql_db functions
The different server monitoring functions all did similar work and
combining them into one function makes the whole process of monitoring a
server simpler.
2016-09-12 15:57:27 +03:00
4cd36161ee Fix stale master detection in multimaster mode
The MySQL monitor now correctly assigns stale status to master servers.
2016-09-12 15:57:27 +03:00