Commit Graph

5589 Commits

Author SHA1 Message Date
889a90fb42 Update 1.3.0 release note. 2016-02-01 10:24:35 +02:00
0ab9733393 The router->rotating is no longer part of Unsafe Pos check
In blr_read_binlog the router->rotating is no longer used for Unsafe
Pos check
2016-02-01 09:12:48 +01:00
7e36e1cbb1 Link against Connector-C.
Now, qc_mysqlembedded is linked against MySQL's embedded library,
and MaxScale itself against Connector-C.

So, in order to build MaxScale, Connector-C must be installed.
This has been tested with Connector-C 2.2.1.

The build variable MYSQLCLIENT_LIBRARIES is no longer used.
2016-01-29 16:50:31 +02:00
e840f92cbb Make query_classifier a wrapper.
The query_classifier library is now only a wrapper that loads an
actual query classifier implementation. Currently it is hardwired
to load qc_mysqlembedded, which implements the query classifier
API using MySQL embedded.

This will be changed, so that the library to load is specified
when qc_init() is called. That will then allow the query classifier
to be specified in the config file.

Currently there seems to be a conflict between the mysql_library_end()
call made in qc_mysqlembedded and the mysql_library_end() call made in
gateway.c. The reason is that they both finalize a shared library.
For the time being mysql_library_end() is not called in gateway.c.
This problem is likely to go away by switching from the client
library to the connector-c library.
2016-01-29 16:35:03 +02:00
5e5a522d27 Rename EMBEDDED_LIB to MYSQL_EMBEDDED_LIB
Makes it clearer what embedded lib we are talking about.
2016-01-29 16:32:01 +02:00
475dfb7288 Use common function for setting up MySQL connection.
Earlier the same (or almost the same) code was duplicated in
several places.

A conflicting declaration was also removed. There was no
implementation for that declaration.
2016-01-29 16:30:48 +02:00
0902297fe5 Clear passwords provided via arguments
If a password is gived as an argument, that password is shown to other users.
Changed it so that the password is copied locally and the argument cleared.
2016-01-29 11:47:15 +02:00
28c9892db0 Moved HA tutorials to the Tutorials folder
The Corosync/Pacemaker and Lsyncd tutorials were in the reference folder even
though they are tutorials.
2016-01-29 10:59:25 +02:00
e3ebf19ca0 Moved HA tutorials to the Tutorials folder
The Corosync/Pacemaker and Lsyncd tutorials were in the reference folder even
though they are tutorials.
2016-01-29 10:59:25 +02:00
d054f5d7bd Cleanup of dbusers.[h|c]
- All functions used only in c-file declared as static.
- All module functions declared.
- A few camelClase names changed to underscore.
2016-01-29 10:54:41 +02:00
5ed58df9f6 Make hashtable const correct.
Hashtable need not modify the filename when loading or saving
the hashtable; consequently the filename can be passed as const.
2016-01-29 10:53:01 +02:00
74281401d8 Added missing option for getopt
The --language short option -N did not work and the errmsg.sys file
was always searched for in the wrong place.
2016-01-28 18:52:46 +02:00
d9b022db10 Protect updating of router when rotating.
When rotating, all state variables of router are now updated while
protected by the router->binlog_lock lock.
2016-01-28 15:23:22 +02:00
59031adba6 MM monitor is built by default
Previously the mmmon module was not built unless -DBUILD_MMMON=Y was added to
the cmake command. The module is now a part of the default build.
2016-01-28 13:17:07 +02:00
8fd515ec8b Fixed MM monitor build failure
The MM monitor was using wrong types of arguments to thread_start and
thread_wait.
2016-01-28 13:14:03 +02:00
379004a2a4 Removed corrupted error messages from readwritesplit
When a slave server fails to execute a session command, the log message printed
the command that was being executed as if the ERR packet was a COM_QUERY packet.
This caused corrupt strings to be printed into the error logs.
2016-01-28 13:04:23 +02:00
0deffbf2f2 Ensure that slave->cstate contains meaningful value.
In blr_slave_callback the bits of slave->cstate are reset and
set as one transaction. Earlier they were reset in one and
set in another, leading to a situation where slave->cstate did
not contain a sensible value for a short period of time.

Further, it is now explicitly checked in blr_distribute_binlog_record
that slave->cstate indeed contains a meaningful value.
2016-01-28 11:00:07 +02:00
e6d18f0b66 Fixed debug assertion causing a crash in readwritesplit
A debug assertion in the readwritesplit would always fail when the master DCB
was NULL. This was caused by the fact that the debug assertion assumes that the
pointer that is passed to it is a valid pointer.
2016-01-28 10:46:55 +02:00
743a1b1037 Removed unnecessary calls to atomic_add
The polling statistics collection used atomic_add to increment values. This
is not an optimal way to update statistical values. Moved to per thread
values which are summed up when they are read.

Moved the functions used to gather polling statistics to their own file and
created a specific data type for statistics.
2016-01-28 09:55:26 +02:00
5e8ba4b519 Introduce MySQL-embedded based query classifier plugin.
Currently not used, but the existing query_classifier will be
changed into being just a wrapper around a dynamically loaded
query classifier plugin, i.e. qc_mysqlembedded.
2016-01-28 08:26:32 +02:00
d6840cd16a Add query classifier plugin interface.
Added a query classifier plugin interface using which plugins
export their functionality. Cleaned up header slightly as well.

This is the first step in the process of making the loading of
the query classifier truly dynamic.
2016-01-28 08:24:32 +02:00
05fa498dc0 Add an SSL header needed to support extra data in DCB. 2016-01-27 15:46:50 +00:00
8367d93746 Migrate SSL functionality out of service and into listener. Develop config handling accordingly, including making provision for SSL parameters in servers for future use in implementing SSL to backend servers. Some elements still to be tidied mainly in mysql_client.c - but that will be part of detaching the SSL authentication from the MySQL protocol. 2016-01-27 15:46:19 +00:00
0111df3767 Cleaned up the use of thread types
The THREAD type was not used everywhere and pthread_t was used instead.
The thread creation function also returned the address of a stack allocated
value which isn't guaranteed to be usable.
2016-01-27 09:07:55 +02:00
e58148356d Split off listener functionality and move SSL initiation from service to listener. Put GWPROTOCOL in its own header file. 2016-01-26 16:08:02 +00:00
da1a717dd8 Add extern "C" to modules.h. 2016-01-26 14:50:41 +02:00
087ab202c2 MXS-559: Fixed unsafe use of the master DCB in readwritesplit
The master DCB was used without checking if it was still open. It was possible
that the master DCB was closed and processed before the client had fully
processed all queries which caused it to fail at a debug assertion.

The fix to this is to use the client's DCB to get access to the shared session
authentication data as it is protected by additional locks.
2016-01-26 14:48:01 +02:00
9a8838474c Add query classifier plugin.
Basic infrastructure added for being able to load query classifier
plugins using the same mechanism other plugins are loaded with.
2016-01-26 10:40:43 +02:00
42b1722e49 Make query classifier self-contained.
Only the query classifier needs the functionality of the embedded
server, while the rest of MaxScale is content with the client
library or Connector/C.

This have now been rearranged so that query-classifier links with
the embedded static library and then explicitly exports its own
functions using the query_classifier.map linker script. That way
query classifier will use the embedded library, while the rest of
maxscale use the client library, and this without conflicts.

Currently, query_classifier is not linked to maxscale-common,
but executables must link to maxscale-common and query_classifier.
2016-01-25 21:43:49 +02:00
0b742977dd Add specific thread main function.
Earlier thread initialization was done in poll_waitevents(),
which was somewhat confusing, since the main thread also calls
into poll_waitevents().

Now there is a specific thread "main" function, which first
performs thread specific initialization and then calls into
poll_waitevents().
2016-01-25 20:41:30 +02:00
1a4fc56c67 Unsafe Pos detection moved into blr_slave_catchup and removed router->rotating check
Unsafe Pos detection moved into blr_slave_catchup and removed
router->rotating check
2016-01-25 12:27:57 +01:00
80cee351c4 Add platform.h
Platform.h is intended to contain definitions and workarounds
for concepts that depend upon the used compiler and/or platform.

Currently it ensures that /thread_local/ is available irrespective
of whether the source is compiled in pre- or post C11 or C++11 mode.

This file should be included first by all MaxScale headers.
2016-01-25 11:20:16 +02:00
1f241a5ed1 Rearrange libraries and build files.
This is the first change in an attempt to arrange the linking so that
more errors are detected at link-time.

- All files in server/core but for gateway.c are linked to one shared
  library called maxscale-common.
- The files log_manager/log_manager.cc and utils/skygw_utils.cc are
  built into maxscale-common as well.
- MaxScale itself consists now only of gateway.c and is linked with
  maxscale-common.
- All plugins link with maxscale-common.
- All executables link in addition with {EMBEDDED_LIB}.

After this change, the change (MXS-517) where query_classifier is the
only component that uses ${EMBEDDED_LIB} and the rest mysqlclient can
be made much cleaner.

After a few additional steps, all shared libraries can be linked with
the linker flags "-Wl,-z,defs", which directs the linker to resolve
all symbols. That will require that all shared libraries list all the
libraries they need, but will at the same time ensure that any
missing symbols are detected at link-time and not at run-time.
2016-01-22 23:26:17 +02:00
a61cedb1aa Fixed freeing of wrong pointer
The wrong pointer in server_free was used to clear the server parameters.
2016-01-22 18:55:54 +02:00
5ac1ab412e Formatted utils library sources
Formatted all utils library sources according to the style guide.
2016-01-22 18:55:54 +02:00
cceeb2d234 Formatted maxadmin.c
Formatted maxadmin.c according to the style guide.
2016-01-22 18:55:54 +02:00
608924beba Build pcre2 as PIC.
If pcre2 is to be included in a shared library, it needs to be PIC.
2016-01-22 15:09:50 +02:00
c8253cc767 Pass CMAKE_C_FLAGS to pcre2.
Now possible to affect CFLAGS of pcre2 build.
2016-01-22 15:08:02 +02:00
99f39cb213 MXS-548: Added missing locks to shared session data
The shared session data was accessed and modified without a lock.
2016-01-21 10:25:41 +02:00
872d02db3e Finalized configuration processing cleanup
All parts of the configuration processing are now in their own functions.
This allows new objects to be created after MaxScale has started.
2016-01-20 09:25:03 +02:00
8ba14ee4ee Fixed init script issue on Ubuntu
The init script split the command and the arguments with double quotes causing
the service to run as root instead of the maxscale user.
2016-01-19 19:29:25 +02:00
b386138fe4 Updated help messages and manpage
The manpage was out of date and was missing a BUGS section. The `--help` output
of MaxScale wrongly stated that the default is to log to shared memory as did
the documentation.
2016-01-19 18:36:01 +02:00
e67ebffaff Updated help messages and manpage
The manpage was out of date and was missing a BUGS section. The `--help` output
of MaxScale wrongly stated that the default is to log to shared memory as did
the documentation.
2016-01-19 18:36:01 +02:00
011636cfcf Disabled connection_timeout because it's unsafe to use
The current implementation of the session timeout functionality is not safe to
use. Added a warning to the documentation and disabled the code. If the user
tries to use it, a warning is logged.
2016-01-19 15:29:01 +02:00
b470ebe732 Disabled connection_timeout because it's unsafe to use
The current implementation of the session timeout functionality is not safe to
use. Added a warning to the documentation and disabled the code. If the user
tries to use it, a warning is logged.
2016-01-19 15:29:01 +02:00
508c91be32 Cleaned up monitor configuration processing
Moved the monitor configuration processing into its own function and cleaned
it up.
2016-01-19 14:23:44 +02:00
53ac88a1a1 Cleaned up the process of adding filters and servers to a service
Moved the adding of filters, servers and router options to its own function.
2016-01-19 14:23:44 +02:00
0aaba891a3 Cleaned up server configuration processing
Moved the creation of new servers into a separate function and cleaned up
the configuration processing.
2016-01-19 14:23:44 +02:00
c6dfcb66f5 Cleaned up service configuration processing
Moved the allocation and configuration of services into their own function.
Moved SSL parameter validation into a separate function.
2016-01-19 14:23:44 +02:00
f12be9fea2 MXS-549: Change MaxScale's working directory on startup
MaxScale now changes the working directory to the log directory when it is
started. If this fails, the file system root is used instead.
2016-01-19 13:59:38 +02:00