79 Commits

Author SHA1 Message Date
VilhoRaatikka
6707d6d0cf Complamentatry fix to that of #575.
resolve_maxscale_homedir returned always false due to succp variable which wasn't updated in successful case.
2014-10-14 18:13:04 +03:00
VilhoRaatikka
726ab87f4b Fix to #575, http://bugs.mariadb.com/show_bug.cgi?id=575
log_manager.cc:
	Log manager handles cases where there are mismatch in user privileges.
	Mark log files enabled in the global lm_enabled_logfiles_bitmask after initialization so that it reflects reality in error cases. In general, take into account the possibility that any phase in initialization may fail and read return values.
	Replaced file_exists_and_is_writable to check_file_and_path which has a slightly different logic and which detects if file open fails for a few different reasons.
	Improved logging (in stderr) in general in error cases.

gateway.c: Also check home directory accessibility in case when it is provided as a command-line argument. Added function check_dir_access to provide that function. Read return value of skysql_logmanager_init and exit (nicely) if it failed.

skygw_utils.cc: initialize mlist with version number 2, which indicates that object is initialized (different than zero) and that there are no active updates on the object (version%2==0).
2014-10-14 13:22:16 +03:00
VilhoRaatikka
34400ee551 Fixed the use of nanosleep which removed a spinloop and degraded the performance dramatically. 2014-10-10 23:53:55 +03:00
Markus Makela
ebb3b52fdb Included the my_config.h header before any system headers if mysql headers were used. 2014-10-10 12:30:21 +03:00
VilhoRaatikka
2bd93025a9 Fix to bug #558, http://bugs.mariadb.com/show_bug.cgi?id=558
Added #include <strings.h> and length indicator to strncasecmp call.
Fix to bug #513, http://bugs.mariadb.com/show_bug.cgi?id=513
Replaced usleep with nanosleep.
2014-10-09 15:51:46 +03:00
Markus Makela
b0683d9b4d Updated the licensing year from 2013 to 2013-2014 2014-10-01 14:37:12 +03:00
Markus Makela
0acb8fe05d Renaming missed SkySQL references. 2014-10-01 13:48:00 +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
3430fc99d2 Shutdown fix in housekeeper
In memory logging in blr_master
2014-09-26 12:36:59 +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
Mark Riddoch
503b942b5c bug 506 - add command line option (-l --log=file) to log to file or
shared memory. Only affects trace and debug logs.
2014-09-19 18:24:11 +01:00
Mark Riddoch
fd92b60336 Merge branch 'hholzgra-hartmut-getopt_long' into release-1.0beta-refresh
Conflicts:
	client/maxadmin.c

Resolved
2014-09-19 17:43:41 +01:00
MassimilianoPinto
8b5b4a17fe Merge from Z3
Merge from Z3
2014-09-11 12:51:16 +02:00
MassimilianoPinto
7245d1baa1 blr branch merge
blr branch merge
2014-09-11 12:20:42 +02:00
Hartmut Holzgraefe
59251ec878 added signal handler for fatal signals like SIGSEGV
that tries to write a call trace to error log
(or if that fails to stderr) before triggering
a core dump
2014-09-09 11:44:47 +02:00
Hartmut Holzgraefe
6a03976e4f support --long options with getopt_long() 2014-09-03 01:03:10 +02:00
VilhoRaatikka
0fed5c2c5b Fix to bug #510, http://bugs.skysql.com/show_bug.cgi?id=510, made every MaxScale thread to call mysql_thread_init() before entering poll_waitevents. Also main thread does this before starting services. Removed all calls to mysql_thread_init() and to mysql_thread_end() from elsewhere than from poll.c:poll_waitevents and from gateway.c:main
skygw_utils.cc: replace_literal: fixed memory leak
2014-09-01 19:37:31 +03:00
Mark Riddoch
877442c941 Addition of periodic task execution via the housekeeper thread
Addition of 15, 5 and 1 minute load averages in poll
2014-08-29 16:53:05 +01:00
MassimilianoPinto
ee582bf2b2 write MaxScale PID into pidfile
write MaxScale PID into pidfile
2014-06-29 17:53:25 +02:00
Mark Riddoch
189793f992 Clean up some compiler warnings 2014-06-16 08:40:04 +01:00
VilhoRaatikka
c927057b5c Fixed two bugs of which one was older.
1. in query_classifier.cc autocommit_enabled, and transaction_active variables maintained their values across different sessions. Now those values are stored in each router_client_ses object.
2. As a part of implementation of MAX-95 session variables were added to BACKEND struct which is shared with all sessions using the SERVICE which the particular BACKEND serves. Now each router_client_ses object has a backend reference struct which includes pointer to BACKEND, DCB and to session command cursor.

Added test - set_autocommit_disabled.sql, test_after_autocommit_disabled.sql - to check that session variable is discarded when session where it belongs terminates.
2014-04-28 23:33:49 +03:00
VilhoRaatikka
2fcc371606 Added back --skip-innodb to a call argument for libmysqld 2014-04-15 19:22:46 +03:00
VilhoRaatikka
2c17dc3edf Bug #418, added functions to query classifier to detect if SET autocommit is called.
Note: this compiles but doesn't work yet properly.
2014-04-09 23:43:03 +03:00
VilhoRaatikka
5e3ec5b3c8 Added "--no-defaults" to arguments that are passed to mysql_library_init. It tells to embedded server not to use any external my.cnf configuration file. 2014-03-29 12:27:02 +02:00
VilhoRaatikka
4150b124a4 Bug # 397
http://bugs.skysql.com/show_bug.cgi?id=397

Avoid calling free with NULL pointer.
2014-02-07 12:47:07 +02:00
Mark Riddoch
1e25d304e7 Add check that the argument to the -c option is a directory. 2014-02-06 13:46:07 +01:00
Mark Riddoch
e97ab93966 Tidy up of the exit status based on the issues founf during startup.
See Bugzilla 370.
2014-02-05 12:20:53 +01:00
Mark Riddoch
fa79a121e6 Updated server version added to the prompt and in the log files.
See Bugzilla bug 376.
2014-02-05 11:29:20 +01:00
vraatikka
97bc1ed042 Fixed comments to be compatible with doxygen 2013-12-13 19:11:10 +02:00
vraatikka
d700754baa log_manager.cc
Bug #372, http://bugs.skysql.com/show_bug.cgi?id=372
	Do not exceed the buffer capacity in log writing. Now longer strings are cut to fit to the buffer.
2013-12-13 15:21:48 +02:00
vraatikka
4ce4423b3e Made comments doxygen compatible. 2013-12-13 10:52:34 +02:00
vraatikka
d403018fd9 Surrounded every log writing command with LOGIF macro, which tests if the given logfile id matches with those enabled. The comparison is done against local variable and expensive function call is avoided. 2013-12-12 16:14:33 +02:00
vraatikka
272ca036e4 log_manager.h
Added macros which allow for testing locally if log is enabled or not.

server/Makefile
	Added directory creation command to Makefile. This fixes problem where errmsg.sys was copied to MaxScale/mysql instead of MaxScale/mysql/errmsg.sys

dcb.b
	Added external variable which carries the information of enabled logs from log_manager.cc

gateway.c
	Tuned logging.
2013-12-12 07:05:38 +02:00
vraatikka
f785420cc6 Double freeing memory. 2013-12-10 17:27:45 +02:00
vraatikka
10eafd61bc Added more information to error message in case where mysql_error provides wrong error message. 2013-12-09 13:35:45 +02:00
vraatikka
1c55a4cee7 Added a hint for the user in case the libmysqld fails to init. 2013-12-09 11:58:06 +02:00
vraatikka
f50de7a084 build_gateway.inc
Removed MARIADB_SRC_PATH
	Added MYSQL_ROOT - root directory where MariaDB headers are installed
	Added MYSQL_HEADERS - -I notation for three header directories
	Added EMBEDDED_LIB - for embedded library directory
	Added ERRMSG - for errmsg.sys file

log_manager.cc
	Little fixes

log_manager/makefile
	Updated header include directive

makefile.inc
	Removed DEBUGGER and BACKGR as unnecessary
	Added LIB for embedded library file name

query_classifier/makefile
	Updated header include directives and embedded library directory

query_classifier/query_classifier.cc
	clean up

server/core/Makefile
	Updated header include directives and embedded library directory
	Added libaio and install of errmsg.sys

server/core/dcb.c
	clean up

server/core/gateway.c
	Added --language and --skip-innodb to mysql_library_init command-line arguments list
	clean up

server/core/load_utils.c
	clean up

server/modules/monitor/Makefile
server/modules/routing/readwritesplit/Makefile
	Updated header include directives and embedded library directory

utils/skygw_debug.h
	http://bugs.skysql.com/show_bug.cgi?id=369

utils/skygw_types.h
utils/skygw_utils.cc
	clean up
2013-12-06 00:12:41 +02:00
vraatikka
258bcb27da log_manager.cc
Added global variable lm_enabled_logfiles_bitmask which holds a bit for each enbaled logfile. It is updated when situation changes. 

gateway.c
	Changed gateway.c:main so that command-line argument -f specifies either the name of config file in $MAXSCALE_HOME/etc or exact location and name of it. Updated README correspondingly.
	Added eternal variable lm_enabled_logfiles_bitmask to be used for quick check before calling logging library functions.
2013-12-04 09:56:48 +02:00
vraatikka
cbbf3239a5 Doxygen compliance corrections 2013-12-01 21:47:38 +02:00
vraatikka
4a006dd707 Log manager is initialized before configu file name resolution so that if home directory is successfully set, further issues would be logged in log files located under home directory instead of /tmp/.. 2013-12-01 21:37:40 +02:00
vraatikka
6d0d85396e Added global default configuration file name "etc/MaxScale.cnf"
Added following static functions:
        bool  file_is_readable(char*)
        bool  file_is_writable(char)
        void  usage(void)
        char* get_expanded_pathname(char*, char*, char*)
        void  print_log_n_stderr(bool, bool, char*, char*, int)
        bool  resolve_maxscale_conf_fname(char**, char*, char*)
        bool  resolve_maxscale_homedir(char**)

Added new command-line argument '-f' which allows the user for specifying relative, or absolute pathname for configuration file. It is also possible to specify only a file name which will be concatenated to path held in MAXSCALE_HOME environment variable.

Old command-line parameter '-c' allow the user for specifying MaxScale home directory also as relative or absolute path. Relative path will be expanded before tested for readability and for writeability.
2013-11-29 23:49:37 +02:00
vraatikka
8d1553b693 Bugzilla #362, http://bugs.skysql.com/show_bug.cgi?id=362
Modified datadir_cleanup so that it calls nftw to walk the directory tree and remove files and directories it meets.
2013-11-26 21:48:54 +02:00
vraatikka
4057ae0b0f log_manager.cc
renamed file_exists to file_exists_and_is_writable, added missing file open flags.

gateway.c	
	Removed command-line parameter '-m' because setting LD_LIBRARY_PATH after the program has started has no effect.
	Corrected some comments.
2013-11-26 16:52:48 +02:00
vraatikka
973a9a34d7 Added comment about '-m <modules directory>' 2013-11-26 13:07:14 +02:00
vraatikka
bc97b7f5ec log_manager.cc
external optind variable must be reset before using it because getopt may have been called earlier in the same process and without resetting argument parsing fails.

dcb.c
	check dcb state before attempting to write to dcb in dcb_write

gateway.c
	daemon_mode moved to global so that it can be taken into account when deciding where to print messages.
	added get_config_filename by using home directory name given as a parameter. Returns absolute paths to config file and to home directory regardless of home directory argument was relative of absolute.
	In main, arguments are parsed by using getopt.
	Changed argument '-c' to specify home directory because MaxScale.cnf is always in <home>/etc/ directory.
	Added argument '-m' to specify modules directory. Both arguments override any other settings.

skygw_types.h
	Added PATH_MAX
2013-11-26 12:53:46 +02:00
Mark Riddoch
f88969c214 Code tidyup 2013-11-25 16:53:17 +01:00
Mark Riddoch
1437d3f18a Update to arguemnt parsing 2013-11-25 15:50:56 +00:00
Mark Riddoch
050ca7ac7e Some fixes for doxygen generation 2013-11-25 10:12:08 +01:00
vraatikka
3b0d6c23ad log_manager.cc
Commented why spread-down logging is disabled. 
	In MaxScale start, log paths are printed in their complete form to make it easier to copy-paste the names.

gateway.c
	Replaced print_signal_set_error with more general-purpose print_log_n_stderr which prints non-formatted messages to error log and to stderr to the point MaxScale switches to run in daemon process. After that only error log is printed.

skyge_utils.cc
	polish
2013-11-25 10:49:45 +02:00