4362 Commits

Author SHA1 Message Date
Markus Makela
41d26b5b73 Failure to load filters is now a configuration error
When a filter module is not found or the instance creation fails, this is considered
a fatal error and MaxScale will not start. If a failure occurs when the configuration
is being reloaded, the service will not use filters and an error will be logged.
2015-11-17 12:04:47 +02: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
Johan Wikman
453055a6c0 server/modules/protocol: All LOGIFs and skygw_log_writes replaced.
LOGIFs and skygw_log_writes replaced with the equivalent
MXS_[ERROR|WARNING|NOTICE|INFO|DEBUG] macros.
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
Markus Makela
b828b04c05 Fixed debug assertion. 2015-11-17 09:17:29 +02:00
Markus Makela
074f37e997 Fixed crash when filters fail to load
The number of filters wasn't decreased if a filter failed to load resulting
in a crash when the filters were applied.
2015-11-17 03:04:23 +02:00
Markus Makela
5d4fe65b19 Fixed some misaligned brackets. 2015-11-16 21:00:22 +02:00
Markus Makela
6846b0b6b6 Mmmon formatting changes
Fixed indentation, bracket alignment and other minor things.
2015-11-16 20:56:39 +02:00
Markus Makela
797d9dc03d Ndbclustermon formatting changes
Fixed indentation, bracket alignment and other minor things.
2015-11-16 20:56:39 +02:00
Johan Wikman
1bfe85099f server/module/filters: All LOGIF and skygw_log_write calls removed.
All LOGIF and skygw_log_write calls have been replaced with the
equivalent MXS_[ERROR|WARNING|NOTICE|INFO|DEBUG] calls.
2015-11-16 14:25:02 +02:00
Markus Makela
a7e2bf09c8 Cleaned up monitor headers
Formatted all monitor headers according to the coding style.
2015-11-16 14:00:22 +02:00
Markus Makela
65e2b50f96 Removed client hangup error message
The error message did not provide any useful information and was most of the
time a false positive due to EPOLL_RDHUP events calling the hangup function
of the DCB.
2015-11-16 13:59:47 +02:00
Markus Makela
b22d40b06b Fixed PCRE2 beng built when CMake is configured
The bundled PCRE2 library will be built as a separate target and configuring
CMake no longer builds it. Instead, it will only be built when it is out of date.
This requires all targets to declare that they depend on the pcre2 target in
order for it to be built.
2015-11-16 13:59:47 +02:00
Markus Makela
f9c99761d6 Monitor_common formatting changes
Cleaned up monitor_common.c and monitor_common.h
2015-11-16 13:59:47 +02:00
Markus Makela
6dea82631d Galeramon formatting changes
Fixed indentation, bracket alignment and other minor things.
2015-11-16 13:59:47 +02:00
Markus Makela
f3a4bedbf5 Mysqlmon formatting changes
Fixed indentation, bracket alignment and other minor things.
2015-11-16 13:59:47 +02:00
Johan Wikman
1bd16db593 query_classifier: LOGIF and skygw_log_write replaced.
The use of LOgIF and skygw_log_write replaced with the equivalent
MXS_[ERROR|WARNING|NOTICE|INFO|DEBUG] macros.
2015-11-16 13:42:37 +02:00
Markus Makela
40dc49c887 Filters are now loaded and created at startup
Previously filter instances were created when the first session was made. This
caused filter configuration errors to be noticed only after MaxScale was successfully
started. Now filters are loaded and the instance is created when a service applies its filters.
2015-11-16 13:31:33 +02:00
Markus Makela
ab6dae897d Removed unnecessary locking when modifying server status
Server lock was used when the server status was modified even though only
one thread should ever be modifying the server status.
2015-11-16 13:02:17 +02:00
Johan Wikman
a355e1beef Printf format checking added to logging function.
Printf format checking added to logging function and all
issues that were revealed by that fixed.
2015-11-16 12:40:49 +02:00
Johan Wikman
44df53d846 LOGIF and skygw_write_log removed from server/core/*.c
LOGIF and skygw_write_log removed from server/core/*.c and
replaced with calls to MXS_(ERROR|WARNING|NOTICE|INFO|DEBUG).
This is a mechanism change, no updating of the actual message
has been performed.

Currently this causes a very small performance hit, since the
check whether the priority is enabled or not is performed in
the function that is called and not before the function is called.
Once all LOGIFs and skygw_write_logs have been replaced, the
behaviour will be altered back to what it was.
2015-11-16 09:49:12 +02:00
Markus Makela
1f15843d61 Refactored schemarouter to use the resultset.h data types and functions
The generated responses to SHOW DATABASES are now generated by using the resultset.h
data types and functions.
2015-11-16 08:39:49 +02:00
Johan Wikman
b8fda016c9 Log: Some cleanup.
Stuff that does not need to be in the header moved to the
implementation file.
2015-11-15 19:43:45 +02:00
Johan Wikman
bcb918e60b Log: Another step in the move from logfiles to priorities.
skygw_[enable|disable]_log has now been removed from the external
interface and priorities must instead be set using
mxs_log_set_priority_enabled(int priority, bool enabled). A bitmask
is already being updated, but internally and as used by the LOG_IF
macros, the actual enabling is still made using logfile ids.

The configuration entries have been replaced as follows:

	log_messages -> log_notice
	log_trace    -> log_info

The old ones can be used, but cause a warning to be logged.

Similarily the maxadmin commands have been updated.
"[enable|disable] log ..." works as expected, but there will be
a message about it being deprecated. Instead there is now a
[enable|disable] log-priority err|warning|notice|info|debug
command that should be used instead.
2015-11-14 22:28:17 +02:00
Johan Wikman
2dcdab29b6 LOGIF_MAYBE macros cleaned away.
Used in few places and only obscured what was going on.
2015-11-14 22:28:17 +02:00
Johan Wikman
86dcd1cc0f LOGIF_MAYBE macros cleaned away.
Used in few places and only obscured what was going on.
2015-11-14 21:51:27 +02:00
Markus Makela
8d0bd8150a Merge branch 'MXS-329-develop-20151111' into develop 2015-11-13 17:26:34 +02:00
Markus Makela
b0c48c3f66 Updated config.c to use PCRE2
config.c now uses PCRE2 to clean up parameter values.
2015-11-13 16:44:23 +02:00
Markus Makela
0b2e00118a Added missing initialization
The service->protocol->listener was never initialized in serviceAddProtocol
and caused a crash if the listener was not started.
2015-11-13 16:38:22 +02:00
Johan Wikman
841ec695e4 Incorrect error handling corrected. 2015-11-13 12:48:13 +02:00
Markus Makela
76856e6c90 Fixed compiler warnings. 2015-11-13 11:53:12 +02:00
Markus Makela
327c29849c Fixed spelling mistakes in documentation. 2015-11-13 10:39:21 +02:00
Markus Makela
6b88b6b17f Merge branch 'develop' into MXS-329-develop-20151111 2015-11-13 07:48:59 +02:00
Markus Makela
1433d28f5f Added missing initialization for monitor parameters
Monitor parameters were uninitialized and the pointer was used when
the monitors were started.
2015-11-13 06:54:13 +02:00
Johan Wikman
2c1b53c120 Log: Cleanup of API
skygw_ functions removed and replaced with mxs_ equivalents.
logfile_id_t removed.
2015-11-12 18:31:53 +02:00
Johan Wikman
05fbdb1b76 Log: skygw_log_flush replaced with mxs_log_flush.
skygw_log_flush replaced with mxs_log_flush and skygw_log_sync_all
with mxs_log_flush_sync.
2015-11-12 18:28:34 +02:00
Johan Wikman
c7a329e43e Log: skygw_logmanager_init renamed to mxs_log_init.
skygw_logmanager_init renamed to mxs_log_init and skygw_logmanager_done
renamed to mxs_log_finish. skygw_logmanager_exit removed alltogether as
all it did was to call skygw_logmanager_done. That appears to have been
a source for confusion as in many places a call to skygw_logmanager_done
was followed by a call to skygw_logmanager_exit. In addition, the function
skygw_log_done was removed from the header, since it lacked an
implementation.
2015-11-12 16:06:44 +02:00
Johan Wikman
680345d374 Whitespace cleanup of config.c
- Tabs replaced with spaces.
- Allman indentation style
2015-11-12 16:06:02 +02:00
Markus Makela
5efd564573 Fix to MXS-288: https://mariadb.atlassian.net/browse/MXS-288 Added MySQL 5.7 authentication
The change to the mysql.user table in MySQL 5.7 caused MaxScale to stop
working with it. This commit adds functionality that checks which version of
the user data query should be made. It also moves common code related to
server version strings to server.c
2015-11-12 15:24:27 +02:00
Johan Wikman
bdfd72404b Log: skygw_log_rotate replaced with mxs_log_rotate.
With only one log-file no arguments are needed. The maxadmin command
'flush log'  still accepts all the previous arguments, but warns about
them being deprecated.
2015-11-12 14:48:37 +02:00
Markus Makela
0705f38bb9 Fix to MXS-464: https://mariadb.atlassian.net/browse/MXS-464
The ownership change for the /var folders is now done recursively.
2015-11-12 09:42:24 +02:00
Johan Wikman
3cfd1ee4e8 Log: Logging is now done by priority and not logfile.
The native way for logging is now by syslog priority and not by
logfile id. In practice that means that there's a function -
mxs_log_message - that takes a syslog priority. The new logging
macros (MXS_ERROR and friends) call that directly and the old
ones as well after having the logfile id translated into the
equivalent priority.

What is enabled or not is still by logfile id and hence the
priority is internally translated into a logfile id when checking
whether something really should be logged or not.
2015-11-12 08:40:29 +02:00
Markus Makela
e37ba0a63d Fixed build failures due to conflicts
Due to an odd rebase, a conflict was left in externcmd.c
2015-11-11 21:38:37 +02:00
Markus Makela
ba9da9ae3d Fixed invalid EXTERNCMD allocation
externcmd_allocate now returns either a valid EXTERNCMD or NULL.
2015-11-11 21:26:10 +02:00
Markus Makela
2d600868f5 Added argument substitution to monitor scripts 2015-11-11 21:19:07 +02:00
Markus Makela
466224b316 Moved common monitor code to externcmd.c
File existence and permission checks are now done in externcmd_can_execute
2015-11-11 21:19:07 +02:00
Markus Makela
d56843835c Cleaned up externcmd_allocate and externcmd_free 2015-11-11 21:19:07 +02:00
Markus Makela
9ab5326960 Fix to MXS-438: https://mariadb.atlassian.net/browse/MXS-438
Maxinfo now supports the shutdown command which shuts down a service, monitor
or MaxScale itself and the restart command which restarts a stopped monitor
or service.
2015-11-11 18:59:39 +02:00
Markus Makela
3ea55e3b50 Fix to MXS-437: https://mariadb.atlassian.net/browse/MXS-437
Maxinfo now allows users to flush logs and change the server status
through the MySQL interface.
2015-11-11 18:57:19 +02:00