4432 Commits

Author SHA1 Message Date
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
01f2aa8d1b All but LOG_INFO and LOG_DEBUG are logged to syslog.
*If* syslog logging is enabled, then all messages but LOG_INFO
and LOG_DEBUG are logged to syslog.
2015-11-25 09:24:48 +02: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
Markus Makela
51e41bb2e3 Updated binlog router tutorial
Renamed all occurences of replication proxy with Binlog Server.
2015-11-24 20:49:47 +02:00
Markus Makela
59b0555090 Made function parameters const where possible.
Some of the functions for dbfwfilter were taking char* arguments where
const char* was more appropriate.
2015-11-24 13:54:50 +02:00
Markus Makela
cbc1872b2b Refactoring of dbfwfilter limit_queries parsing
Moved parsing of limit_queries into a separate function.
2015-11-24 13:54:50 +02:00
Markus Makela
76dc63efa2 Moved rule definition parsing to its own function
A large part of parse_query was parsing of the actual rule definitions. This made
the function very large and hard to understand. For this reason the definition parsing
was moved to its own function.
2015-11-24 13:54:50 +02:00
Markus Makela
62ca9ab8ec Moved parsing of at_times rules to a separate function
This was done in order to make the parse_rule function smaller and easier to
comprehend.
2015-11-24 13:54:28 +02:00
counterpoint
34f045ca75 Merge remote-tracking branch 'origin/develop' into MXS-472a 2015-11-24 10:19:18 +00:00
counterpoint
1af89298b9 Changes to Galera monitoring logic and tidying up following code review. 2015-11-24 10:08:07 +00: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
Johan Wikman
910ddb99fd Reset sessionid upon exit.
Since the sessionid is now unconditionally set, it also needs to
be unconditionally reset.
2015-11-23 18:44:38 +02:00
Markus Makela
c6982b863a Added missing initialization of values
A call to localtime_r was done with an uninitialized time_t value.
2015-11-23 18:33:59 +02:00
Johan Wikman
62b0e5fab0 Session info always copied to tls
Maxadmin earlier gave the impression that you could change whether
messages for different log files could be specifically enabled for
a session. In practice that was true only for trace messages as the
session id and the bitmask telling what logfiles are enabled, were
copied to thread local storage only as far as trace messages were
concered.

The code for setting that information in place is quit short and
efficient, so there is really no reason not to do that always.
This also means that it always will be possible to get your hands
on the session object if there is a need for that.
2015-11-23 18:14:46 +02:00
Markus Makela
d7e685e2fe Increased version number.
MaxScale version number set to 1.3.0-1.
2015-11-23 13:06:39 +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
37f8374a10 Fixed multiline configuration processing
The regular expression used when cleaning multiline configuration parameters
didn't match trailing backslash characters in pathnames. This caused them to be
added to the next line causing a possible error.
2015-11-21 15:21:23 +02:00
Markus Makela
47e2e4d3e0 Configuration parameters were uninitialized
The creation of a CONFIG_PARAM didn't initialize the qdf_param_type value which
was later used when adding parameters to the monitors.
2015-11-21 03:44:06 +02:00
counterpoint
edb84ab119 Fix logic errors in determine monitor event type, improve comments. 2015-11-20 12:13:43 +00:00
counterpoint
ece53a8ac5 Fix Galera monitor problem with leaving wrong status for significant periods; change warning message from logging as warning instead of notice. 2015-11-20 10:15:13 +00: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
counterpoint
95e143a146 Remove references to monitor_common is cmake file for monitors. 2015-11-19 16:36:02 +00:00
MassimilianoPinto
023d4bc588 Develop merge
Develop merge
2015-11-19 17:06:30 +01:00
counterpoint
a58b25d6c3 Fix mistakes 2015-11-19 15:51:18 +00:00
counterpoint
e7a30a7944 Overhaul monitor_common functions and move into monitor.c 2015-11-19 15:40:43 +00: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
Markus Makela
84d2c72db2 Formatted mqfilter
Mqfilter formatted according to the style guide.
2015-11-19 12:16:47 +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
6613723a1f Update error message when startup fails
Claiming that the loading of maxscale.cnf failed in case of any
error was misleading. Maxscale may not succeed in opening it,
reading it or processing it.
2015-11-19 09:28:14 +02:00
Johan Wikman
0345f3622d LOGIF and skygw_log_write removed.
All places where LOGIF and skygw_log_write were used have been
updated to use the new logging macros instead. Consequently,
they can now be removed.
2015-11-19 09:26:27 +02: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
3e3770fa82 ss_dassert() no longer uses skygw_log_write.
Use of skygw_log_write() in ss_dassert and ss_info_dassert replaced
with the use of MXS_ERROR(). In addition, ss_dassert and ss_info_dassert
are now expressions that require a trailing ;.
2015-11-18 14:56:08 +02:00
Markus Makela
cbeead7c43 Formatted namedserverfilter
Namedserverfilter formatted according to the style guide.
2015-11-18 14:44:05 +02:00
Markus Makela
036fd6f16c Formatted qlafilter
Qlafilter formatted according to the style guide.
2015-11-18 14:31:02 +02:00
Markus Makela
a7c0952e66 Formatted tee filter
Tee filter formatted according to the style guide.
2015-11-18 14:18:00 +02:00
Markus Makela
e24504c427 Formatted topfilter
Topfilter is now formatted according to the style guide.
2015-11-18 13:46:23 +02:00
Markus Makela
7d9324ee12 Formatted regexfilter
Formatted regexfilter according to the style guide and removed trailing whitespace.
2015-11-18 13:35:04 +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
Markus Makela
eb0cf745ca Filters not being found is now an error instead of a warning.
The log message was labeled as a warning instead of an error and finding out
the real reason why MaxScale didn't start when a filter wasn't found was difficult.
2015-11-18 11:50:35 +02:00
Markus Makela
da74bb7c3f Formatted dbfwfilter according to the style guide
Fixed indentation, bracket alignment and other minor things.
2015-11-18 10:12:04 +02:00
Markus Makela
86db0f8754 Fixed event names being truncated
A buffer was allocated for strlen(event) characters leading to the
name always being truncated by one character. The use of a buffer was
unnecessary and was fixed by using the mon_get_event_name function directly.
2015-11-18 04:35:03 +02:00