389 Commits

Author SHA1 Message Date
MassimilianoPinto
e777828bd0 When creating heartbeat packet too many bytes were copied.
The memory area ‘ptr’ points to contains now the right data
2016-02-11 17:12:10 +01:00
Johan Wikman
4a4f22c9a7 Make query_classifier part of core.
The query classifier interface is now built as an integral
part of MaxScale core.
2016-02-08 11:44:07 +02:00
Markus Makela
081bacdc64 Switched to MySQL client library headers for MaxScale
The include directories previously used by MaxScale were from the embedded
library. All parts of MaxScale apart from the query classifier now use
the client libraries.
2016-02-02 14:04:59 +02:00
Johan Wikman
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
Johan Wikman
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
Johan Wikman
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
Johan Wikman
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
MassimilianoPinto
5b91f98067 Removed the 16 chars limitation for binlog file name
Removed the 16 chars limitation for binlog file name
2016-01-07 14:36:52 +01:00
MassimilianoPinto
901dfd23c0 Changed burst_size to long instead of unsigned long
Changed burst_size to long instead of unsigned long.
This way check burst_size > 0 is now effective.

Setting "burstsize" option in router_options may be required.
i.e.: burstsize=10M
2015-12-30 16:14:51 +01:00
Markus Makela
080a9ebc9d PCRE2 is now statically linked
Since the PCRE2 library was always going to be a part of MaxScale, there was
no real reason to have it as a shared library apart from smaller binaries.
2015-12-29 10:09:38 +02:00
Johan Wikman
04f807290a Remove file from slave
The binlog file is now always opened when it is needed and closed
when we are finished with it. That will remove any potential
file concurrency issues between different threads dealing with
the same slave.
2015-12-29 09:42:09 +02:00
MassimilianoPinto
71212a824b Removed extra brace
Removed extra brace
2015-12-28 17:56:39 +01:00
MassimilianoPinto
0f51f9c714 Changed behaviour for a slave requesting master_log_pos beyond binlog file size
Slave request for a log_pos behind binlog file size may result in a
disconnection or replication error:

if binlog file is latest one slave get disconnected otherwise an error
message is returned and replication stops
2015-12-28 17:56:33 +01:00
Markus Makela
3139be8e5a Fixed SHOW SLAVE STATUS showing obsolete slaves
If SHOW SLAVE STATUS was executed after DISCONNECT ALL it was possible that
some of the disconnected slaves were used when printing slave hosts.
2015-12-10 15:50:20 +02:00
Markus Makela
000a044da6 Slaves are set to unregistered state once disconnected
It was possible that the same slave was disconnected multiple times
before the slave DCB was closed.
2015-12-10 15:50:20 +02:00
Markus Makela
9a3aae64ce Replaced explicit closeSession calls with dcb_close
The closeSession entry point shouldn't be called directly and dcb_close
should be used instead.
2015-12-10 15:50:20 +02:00
Johan Wikman
49cf4089fc Make state-change logging conditional. 2015-12-10 15:50:20 +02:00
Johan Wikman
f49bd06a7e Reduce logging of binlog server
Only the true state changes of a slave - up-to-date -> catch-up
or catch-up to up-to-date - are logged.
2015-12-10 15:50:20 +02:00
MassimilianoPinto
43c5a495a2 Removed useless spaces
Removed useless spaces
2015-12-10 15:50:20 +02:00
MassimilianoPinto
3f31f5548d Addition of slave transition to catchup mode in logging
Addition of slave transition to catchup mode in logging
2015-12-10 15:50:20 +02:00
Johan Wikman
231a620dc0 Remove >= 0 check from unsigned type. 2015-12-08 14:37:21 +02:00
Johan Wikman
1deea7f929 Remove unnecessary comparison.
It makes no sense to compare an unsigned integer for non-negativeness;
it won't ever be. router_instance.lastEventReceived is uint8_t.
On centos5 this causes a warning that thus ends the compilation.
2015-12-08 13:28:11 +02:00
MassimilianoPinto
7119ed817d Transaction safety default is off in binlog router
Transaction safety default is off in binlog router
2015-12-02 11:18:12 +01:00
MassimilianoPinto
1c1d4b205a Merge branch '1.2.1-binlog_router_trx' into develop 2015-12-01 09:37:47 +01:00
MassimilianoPinto
6367ac7148 Changed log level for up to date transition
Changed log level for up to date transition
2015-11-30 19:23:36 +01:00
MassimilianoPinto
592e4d06cb Changed name for bad fd
Changed name for bad fd
2015-11-30 10:22:47 +01:00
MassimilianoPinto
ba135c5548 Log messages fix with slave ip:port and id
Log messages fix with slave ip:port and id
2015-11-30 10:22:12 +01:00
Markus Makela
a829b38873 Fix to MXS-363: Added soname versions to libraries
The soname version numbers were missing from all the library targets
properties which caused ldconfig to warn about non-symlink libraries
being installed.
2015-11-30 10:46:08 +02:00
MassimilianoPinto
dcf81db395 Merge branch '1.2.1-binlog_router_trx' into develop 2015-11-30 09:40:04 +01:00
MassimilianoPinto
14d11fa4c0 Changed name for bad fd
Changed name for bad fd
2015-11-27 09:43:58 +01:00
MassimilianoPinto
5a64fc70dc Log messages fix with slave ip:port and id
Log messages fix with slave ip:port and id
2015-11-27 09:16:17 +01:00
MassimilianoPinto
dd922a1ff9 Added check for missing service listener
Added check for missing service listener
2015-11-26 17:00:30 +01:00
Johan Wikman
916ee5ff2a Rename some log concepts
The mxs prefix is now uniformly used with all log components.
2015-11-26 17:34:53 +02:00
Johan Wikman
e38334c457 Fix locking issue in blr_close_binlog
In blr_open_binlog the refcnt increase of file which is already
open is protected by router->fileslock. In blr_close_binlog the
decrease of the refcnt was protected by file->lock.

This lead to a situation where it was possible that a file was
closed and the file instance freed, even though it just had been
taken into use by somebody else.

This is now fixed by solely using the router->fileslock for protecting
the increase and decrease of the refcnt.
2015-11-26 10:34:34 +02:00
Markus Makela
038877b8db Fixed minor format errors and resource leaks
Some format strings used integer values for unsigned integers.
Memory and file descriptors leaked in some error conditions.
2015-11-25 12:43:49 +02:00
counterpoint
dcf0d4ef4b Merge remote-tracking branch 'origin/MXS-472a' into develop 2015-11-25 10:42:52 +00:00
MassimilianoPinto
5353353a3a Merge '1.2.1-binlog_router_trx' into develop 2015-11-25 10:53:55 +01:00
counterpoint
68a7f4b472 Merge remote-tracking branch 'origin/develop' into MXS-472a 2015-11-23 10:05:55 +00:00
Markus Makela
23b2ce004b Added support for MariaDB 10.1 embedded library
The code used in the query classifier was not compatible with 10.1 version
of MariaDB and needed to be fine tuned in order for it to work with all
supported versions of MariaDB.
2015-11-23 11:41:05 +02:00
Johan Wikman
c167499c7b Add notice about previous failure to unlock.
In blr_slave.c under certain conditions, two locks were not released.
That was fixed in another change, and with this change a notice will be
logged if that branch is entered. That way it will be possible to find
out whether this may have been the cause of earlier lock-ups.
2015-11-23 09:51:59 +02:00
Johan Wikman
1b9920ef10 Add notice about previous failure to unlock.
In blr_slave.c under certain conditions, two locks were not released.
That was fixed in another change, and with this change a notice will be
logged if that branch is entered. That way it will be possible to find
out whether this may have been the cause of earlier lock-ups.
2015-11-23 09:25:50 +02:00
MassimilianoPinto
99fdf9cdec Fixed reference to LOGIF macro
Fixed reference to LOGIF macro
2015-11-19 17:54:23 +01:00
Markus Makela
b7ce68aa1c Added missing source files to maxbinlogcheck
The build files for monitors were referring to monitor_common.c which was
refactored out and combined with monitor.c. Due to this change, maxbinlogcheck
required maxscale_pcre2.c and externcmd.c.
2015-11-19 18:46:39 +02:00
MassimilianoPinto
023d4bc588 Develop merge
Develop merge
2015-11-19 17:06:30 +01:00
MassimilianoPinto
90d2dc336c Missing lock release added
Missing lock release added and log message update
2015-11-19 08:58:49 +01:00
Johan Wikman
3f8739ebfd LOGIFs removed from binlog test. 2015-11-18 13:23:16 +02:00
Johan Wikman
afdeb6fa5b binlogrouter: All LOGIFs and skygw_log_writes replaced.
All LOGIFs and skygw_log_writes replaced with the equivalent
MXS_[ERROR|WARNING|NOTICE|INFO|DEBUG] macros.
2015-11-18 12:35:21 +02:00
MassimilianoPinto
f06eec13f6 Merge branch 'develop' into 1.2.1-binlog_router_trx 2015-11-17 09:50:25 +01:00
MassimilianoPinto
82dc3ff3c5 Update lastReply with heartbeat event
Update lastReply when heartbeat event is seen and a transaction is
still open
2015-11-17 09:47:21 +01:00
MassimilianoPinto
a90b336cc4 blr_master_reconnect instead of blr_start_master
blr_master_reconnect instead of blr_start_master in
blr_stop_start_master
2015-11-16 15:55:08 +01:00