1104 Commits

Author SHA1 Message Date
Markus Makela
d6afe70c6f Fix to MXS-323: Routers properly handle client DCB errors
All routers now detect if a client DCB is passed to handleError and
take the appropriate action.
2015-12-02 18:01:14 +02:00
Markus Makela
9da0c206bb Added missing brackets
Some curly braces were missing from readconnroute and some function declarations
were misaligned.
2015-12-02 13:36:18 +02:00
Markus Makela
45abfeec2c Fix to MXS-494: Fixed readconnroute weight calculation
The calculation of weights used the actual amount of connections instead of
actual amount of connections + 1. This lead to the weight being effectively
ignored for servers with no connections.
2015-12-02 13:36:18 +02:00
Markus Makela
91eba965fc Formatted readconnroute
Formatted readconnroute files according to the style guide.
2015-12-02 13:36:18 +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
Markus Makela
2e127ef38e Fix to MXS-429: Missing parameter no longer causes a crash
If a server is missing a weighting parameter the default weight will be used.
2015-12-01 12:22:47 +02: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
Markus Makela
02da87f737 Fix to MXS-439: Weightby value of 0 no longer causes a crash
A weightby parameter with a value of 0 no longer causes SIGFPE and the
invalid weight value is set to the correct value of 1.
2015-11-30 19:06:04 +02: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
Johan Wikman
384029c109 MaxScale log called consistently for maxlog
There were some variance regarding the way the MaxScale log (i.e.
the file log) was called; "maxlog" in configuration file and
"maxscalelog" at the command line and maxadmin interface. Now it
is uniformly referred to as "maxlog" in the configuration file, at
the command line, from maxadmin and in the code.
2015-11-27 16:10:37 +02:00
Johan Wikman
2feb2ed3a2 Prevent disabling error log priority.
It should not be possible to disable the error priority as error
messages should always be logged.

In addition some minor corrections of command line texts.
2015-11-27 16:09:57 +02: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
8ae187622c Fixed weightby overflow being silently ignored in readwritesplit
If individual servers had a weightby parameter value greater than INT_MAX * 1000
the integer used for calculation would overflow and the server would end up
having a negative weight. This would cause all connections to pile up on this
server.

The same overflow was possible for the sum of all the weightby parameter values
even if no single parameter exceeded the limit.
2015-11-25 22:43:46 +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
Johan Wikman
af6ec7f346 Allow [en|dis]abling of [sys|maxscale]log via maxadmin.
The syslog and maxscalelog can now be enabled and disabled at
runtime using maxadmin.
2015-11-25 09:16:17 +02:00
Johan Wikman
a8535f42af Remove all traces of logfile_t
The earlier log file based approach for enabling and disabling
messages has now been completely replaced with the syslog priority
based approach.

Similarly as with log files before it is now possible to enable
and disable a log priority for a particular session, even though
it apparently has not been used much.

The local test-programs of the logging has got minimal attention
only to make them compile. They should get an overhaul as they did
not work before either.
2015-11-23 19:10:53 +02: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
Markus Makela
422d6f5ab2 Updated readwritesplit default values
The combination of only one slave being used and the slave_selection_criteria
being LEAST_CURRENT_OPERATIONS can possibly cause a connection pileup on one
slave server. This would skew the query distribution heavily towards the first
available slave even if multiple slave were being used.

Having the maximum number of slave servers to be equal to the total amount of
available slaves allows for a more even and responsive distribution of the
query traffic.
2015-11-20 05:57:51 +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
Johan Wikman
6164b7f301 Fixed unsafe use of localtime
Since localtime is not thread-safe it should not be used in multithreaded
contexts. For this reason all calls to localtime were changed to localtime_r
in code where concurrency issues were possible.

Internal tests were left unchanged because they aren't multithreaded.
2015-11-19 17:17:16 +02: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
ee7793312b Broken error message fixed in readwritesplit.c
When converting the skygw_ logging calls to MXS_ equivalents,
some part of the error message got lost.
2015-11-18 20:51:11 +02: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
Johan Wikman
d59c6a3570 readwritesplit: skygw_log_writes replaced. 2015-11-18 12:28:40 +02:00
MassimilianoPinto
d111fe26cc Merge branch 'develop' into 1.2.1-binlog_router_trx 2015-11-17 14:19:54 +01:00
Johan Wikman
0413c957f8 LOGIFs removed from schemarouters. 2015-11-17 14:18:51 +02:00
Johan Wikman
1de202ca20 LOGIF removed from readwritesplit 2015-11-17 12:51:08 +02:00
Johan Wikman
1b8719ffed LOGIF removed from maxinfo. 2015-11-17 12:50:15 +02:00
Johan Wikman
fb443a9f92 LOGIF removed from readconnroute.c 2015-11-17 12:48:47 +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
Johan Wikman
9c7118eb9a GaleraHACRoute.c removed. 2015-11-17 09:52:27 +02:00
Johan Wikman
ac358af7a6 LOGIF and skygw_log_write removed from cli.c and debugcli.c 2015-11-17 09:21:47 +02:00
Markus Makela
6641c42ef9 Added sync logs command to maxadmin
Added maxadmin command to flush all logs to disk. This will allow tests
to gather all logs without having to wait for the logs to be flushed by
the log flusher thread.
2015-11-17 09:17:59 +02:00