58 Commits

Author SHA1 Message Date
Johan Wikman
7aab966573 Remove mysql prefix.
Now monitor.c includes <mysqld_error.h> and not <mysql/mysqld_error.h>.
The latter can not be found from connector-c.
2016-03-07 16:00:27 +02:00
Markus Makela
2a35312022 Cleaned up the usage of the connector library
The monitor permission checks didn't use the standard connection timeouts but
used hard-coded values. The config.c tried to connect to the embedded library
but since it is not used by it anymore, it always fails.
2016-03-02 21:27:34 +02:00
Markus Makela
fec1ebe925 Removed restrictions on monitor timeouts
The monitor timeouts can now be larger than the monitor interval. This will
allow the combination of low monitoring intervals and large network timeouts.
If a network experiences some periodic lag, it is desirable to allow large
timeout values.
2016-02-19 09:57:15 +02:00
Markus Makela
4f2a87f732 MXS-22: Shutting down monitor now closes database connections
Shutting down monitors is not supposed to be done ofter so there is no true
benefit from keeping the connections open. With the refactoring of the monitor
interface, this can be done in a centralized place.
2016-02-09 11:12:38 +02:00
Markus Makela
cdeb921b1b Added missing freeing of monitor resources
Monitor servers were not freed.
2016-01-15 21:38:40 +02:00
Johan Wikman
74bb291961 Reindent server/core/monitor.c 2015-12-01 09:40:07 +02:00
Markus Makela
230978f6db Added missing logging to externcmd.c
Not all failures caused an error to be logged.
2015-11-27 12:32:27 +02:00
counterpoint
1af89298b9 Changes to Galera monitoring logic and tidying up following code review. 2015-11-24 10:08:07 +00:00
counterpoint
edb84ab119 Fix logic errors in determine monitor event type, improve comments. 2015-11-20 12:13:43 +00: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
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
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
Markus Makela
cd6f7ce046 Fix to MXS-447: https://mariadb.atlassian.net/browse/MXS-447
Monitors are now started after they have been fully configured.
2015-11-11 17:54:41 +02:00
Johan Wikman
834a88aeda Log variables moved to log_manager.h
The log manager variables lm_enabled_log_files_bitmask, log_ses_count
and tls_log_info that earlier were declared separately in every
c-file are now declared in the log_manager.h header.
2015-11-04 14:26:53 +02:00
Markus Makela
c5214bea1b Cleaned up code and changed function structure. 2015-08-28 12:54:38 +03:00
Markus Makela
296bdc5df6 Fixed errors and added comments. 2015-08-28 12:54:38 +03:00
Markus Makela
525daf827a Service are not started if user permissions are inadequate.
Also cleaned up code and error messages.
2015-08-28 12:54:38 +03:00
Markus Makela
cb2b465510 Changed queries to more closely match actual queries. 2015-08-28 12:54:38 +03:00
Markus Makela
b232c49742 Fixed function documentation. 2015-08-28 12:54:38 +03:00
Markus Makela
94eb1b4eb1 Added service and monitor permission checks. 2015-08-28 12:51:37 +03:00
Markus Makela
0062d9d2b7 Version errors for SHOW SLAVE STATUS now only print once. 2015-06-29 10:24:16 +03:00
Markus Makela
fe5e40e397 Added missing initialization of user and password variables in monitor_alloc. 2015-06-03 16:08:11 +03:00
Markus Makela
9c461450e2 Fixes to Coverity defects. 2015-05-22 05:36:58 +03:00
Markus Makela
91bc7b2792 Added missing spinlock calls to all monitors. 2015-05-21 11:41:11 +03:00
Markus Makela
7c7b322e1b Added missing default monitor interval. 2015-05-19 16:20:04 +03:00
Markus Makela
b94f494d80 Added filtering of monitor events. 2015-05-14 12:05:58 +03:00
Markus Makela
6e1a69df7e Changed callable monitor scripts to be called with command line parameters instead of having multiple scripts.
This reduces the amount of guesswork the monitor has to do when executing the script and places that burden on the called script.
2015-05-09 14:03:52 +03:00
Markus Makela
ba3c29c72b Fixed old function calls using monitor handle instead of MONITOR type. 2015-05-09 11:01:16 +03:00
Markus Makela
5a3ed0de9b Moved common monitor functionality to the MONITOR type
Common variables, like databases, timeouts and interval, and functionality was moved to the MONITOR type.
This reduces the redundant functionality of the monitor API's functions like registerServer and setInterval.
2015-05-09 04:47:17 +03:00
Markus Makela
3255979ca1 Fixed monitor handle not being NULL on initialization. 2015-03-12 14:45:39 +02:00
Markus Makela
63d83cd85d Monitor API 2.0.0 implemented. 2015-03-11 15:18:55 +02:00
Markus Makela
1b0fd4576a Merge branch 'maxinfo' into develop
Conflicts:
	server/core/service.c
	server/core/session.c
	server/include/session.h
2015-03-04 11:33:00 +02:00
Mark Riddoch
11e65f02f0 Addition of maxinfo show modules and show monitors commands 2015-02-19 13:32:48 +00:00
Markus Makela
ce063caf56 Fixed stopped monitors getting a call to monitorStop. 2015-02-17 21:47:11 +02:00
VilhoRaatikka
fd11e6a7f5 Session-specific logging. Added functions
void session_enable_log(SESSION* ses, logfile_id_t id)
and
void session_disable_log(SESSION* ses, logfile_id_t id)

Which switch specific log type on/off if the log type in question is not generally enabled.

Each thread carries a thread-specific struct log_info_t which includes members for current session id and bitfield for enabled log types for the current session. That information is checked before actual log write functions are called.

Each file where session-specific logging is used, must include the following exports:

/** Defined in log_manager.cc */
extern int            lm_enabled_logfiles_bitmask;
extern size_t         log_ses_count[];
extern __thread log_info_t tls_log_info;
2014-11-19 00:08:59 +02:00
MassimilianoPinto
62069f7ba9 Missing bracket
Missing bracket
2014-11-07 17:10:24 +01:00
MassimilianoPinto
39cc701b0d Branch update
Branch update
2014-11-07 16:59:01 +01:00
MassimilianoPinto
3b982ae820 Added monitor timeouts for connect/read/write
Added monitor timeouts for connect/read/write
2014-11-07 16:45:06 +01:00
MassimilianoPinto
6f22975e6c Added 'disable_master_failback' monitor option
Added 'disable_master_failback' option in Galera monitor
2014-10-30 19:03:07 +01:00
Markus Makela
b0683d9b4d Updated the licensing year from 2013 to 2013-2014 2014-10-01 14:37:12 +03:00
Markus Makela
f4e591e382 Changed 'SkySQL Gateway' to 'MariaDB Corporation MaxScale' 2014-09-30 13:15:03 +03:00
Markus Makela
c344231f80 Renamed all occurences of SkySQL to MariaDB Corporation 2014-09-30 13:02:10 +03:00
Mark Riddoch
d793382006 Make "list monitors" output consistant with the output from other list
commands
2014-09-25 08:31:29 +01:00
VilhoRaatikka
45f8585804 Fix to bug #549, http://bugs.skysql.com/show_bug.cgi?id=549
Each monitor loops 10 times/second (sleep 100ms) and perform monitoring checks only when monitor's interval is spent. Monitors notice faster if the shutdown flag is set and thus overall shutdown is faster.
hint.c:added missing header
Changed interval from unsigned long to size_t which is guaranteed to be of same size also in windows (if possible).
2014-09-23 11:26:15 +03:00
MassimilianoPinto
63d267e5ef Fix for broken replication
Fix for broken replication has been added to mysql_monitor.
Both Slave_IO  and Slave_SQL threads must be running in order to assign
the SERVER_SLAVE status but If only Slave_IO is running let’s assign
the master_id to current server and continue building the replication
tree; if no slaves at all the master will be still available.
The “detect_stale_master” option has been added, its default is 0.
If set to 1 the monitor will keep the last detected master even if the
replication setup is completely not working, i.e. both Slave_IO  and
Slave_SQL threads are not running: this applies only to the server that
was master before.
After monitor or MaxScale are restarted and the replication is still
stopped or not configured there will be no master because it’s not
possible to compute the replication topology tree.
2014-09-01 11:18:57 +02:00
Mark Riddoch
d6a2ef6996 Misc fixes to doxygen comments 2014-08-19 13:22:40 +01:00
Mark Riddoch
87e66a0ea8 Revert "Implementation of HTTPD protocol, gwbuf properties and a dmeo web application"
This reverts commit 6fd5dff34902051f38932947493280e1e62dbeb1.
2014-07-15 17:53:39 +01:00
Mark Riddoch
6fd5dff349 Implementation of HTTPD protocol, gwbuf properties and a dmeo web application
interface to test the new httpd.
2014-07-15 17:39:31 +01:00
Mark Riddoch
de5d4fda8b Merge of new user interface changes 2014-06-27 09:57:39 +01:00