Commit Graph

114 Commits

Author SHA1 Message Date
2166883383 consistently use size_t for buffer and string length calculations, not int 2015-02-13 17:23:25 +01:00
2b4e6bb594 Merge branch 'develop' into firewall
Conflicts:
	server/modules/filter/test/CMakeLists.txt
2015-01-13 07:48:43 +02:00
6be227f3c4 Added comments, removed non-existing function, cleaned up a bit. 2015-01-12 14:25:37 +02:00
8572a08cab Merge branch 'master' into develop 2015-01-09 11:23:03 +02:00
8de7a5854a Log files names printed only with DEBUG mode
Log files names printed only with DEBUG mode
2014-12-09 11:17:30 +01:00
5264a1abc9 Added function documentation, moved one non-error log entry to message log, cleaned up a bit. 2014-12-08 16:02:16 +02:00
825320dd7a Merge branch 'release-1.0GA' into develop 2014-12-08 10:24:19 +00:00
84679a48ff Fixes to Coverity defects 84335 84336 84337 2014-12-04 10:13:41 +02:00
1e2027f4dc Fixes to Coverity defects 83027 73421 72714 72671 72646 72642 2014-12-03 17:56:22 +02:00
89c3b01925 Fixed the first log write after moving a cleared block buffer being written in the block buffer that was just moved. 2014-12-03 17:11:52 +02:00
f2c2e4f81c Fix to bug #617, http://bugs.skysql.com/show_bug.cgi?id=617
When filewriter_init failed due to full disk, error branch freed messages twice. Removed unnecessary free command.
2014-12-02 23:58:28 +02:00
aab30f2eea If linked log file in /dev/shm wasn't writable a new log file with increased seq.no. was created but the old link was also deleted. This was ok before log rotation and file creation with increasing seq.no was implemented but useless and confusing today.
Enabled printing this also in Release version:

raatikka@linux-yxkl:~/bin/develop/bin> ./maxscale -d -c ../
Info : MaxScale will be run in the terminal process.
Using Home directory command-line argument as MAXSCALE_HOME = /home/raatikka/bin/develop
Error log       : /home/raatikka/bin/develop/log/skygw_err1.log
Message log     : /home/raatikka/bin/develop/log/skygw_msg1.log
Trace log       : /home/raatikka/bin/develop/log/skygw_trace1.log->/dev/shm/7886/skygw_trace1.log
Debug log       : /home/raatikka/bin/develop/log/skygw_debug1.log->/dev/shm/7886/skygw_debug1.log
Home directory     : /home/raatikka/bin/develop
Configuration file : /home/raatikka/bin/develop/etc/MaxScale.cnf
Log directory      : /home/raatikka/bin/develop/log
Data directory     : /home/raatikka/bin/develop/data/data7886

That is, all log files' names and locations are printed on the screen.
2014-12-02 23:15:24 +02:00
bdfdc3b522 Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-02 20:03:14 +02:00
d608eb2532 Fix to bug #622, http://bugs.skysql.com/show_bug.cgi?id=622
Ensured that soft link and physical file will have same sequence number. Prevented some unnecessary error printing and added more precise logs.
2014-12-02 20:02:00 +02:00
bac6795105 Added log synchronization to disk when signals are received. 2014-12-02 15:33:17 +02:00
49534f75b5 Added synchronous log flushing to disk when a signal is received. 2014-12-02 13:31:15 +02:00
e068614651 Yet another 1-char-off bug in log_manager 2014-11-27 19:33:20 +02:00
6def2b611e Fixed some logs not being flushed 2014-11-27 17:31:31 +02:00
3e18e091c1 Fixed unreported bug in log_manager where a terminating character was added in the middle of log message. 2014-11-27 16:53:50 +02:00
013dd8e575 Changed to a skygw_message_t in skygw_log_sync_all. 2014-11-27 16:43:55 +02:00
b07df3b296 Renamed and improved the synchronous log flushing function. 2014-11-25 16:04:23 +02:00
5eaf963ad4 Removed unnecessary debug information and return values. 2014-11-25 14:47:50 +02:00
3d50d8f117 Added a function that flushes all logfiles synchronously. 2014-11-25 14:43:43 +02:00
75e9c30d49 Fixes to Coverity defects 83027 and 72714 2014-11-25 12:09:04 +02:00
155e795830 Fix to #622, http://bugs.skysql.com/show_bug.cgi?id=622
When MaxScale starts it opens log file of each type and if there exist log files of same types in the same directory, it will try to reuse the file with largest sequence number in it. If there are no existing files, a file name with sequence number 1 will be created. If the file with largest sequence number is not writable, a new log file with larger sequence number will be created.
2014-11-21 13:44:12 +02:00
ed461d58e2 Moved messages to message log
Moved messages to message log and others printed only with DEBUG mode
compile setting
2014-11-19 11:36:44 +01:00
580f9730f6 Fix to #621, http://bugs.skysql.com/show_bug.cgi?id=621 2014-11-19 12:14:24 +02:00
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
a30fc0c787 MAX-328, Add session identifier to trace log entries. Session id is given to session in session_alloc and stored to thread's local storage variable when thread picks a new event from epoll_wait. 2014-11-17 23:27:14 +02:00
df9acee69a Fix to bug# 616: Added checks that only one block buffer (the first one) is being moved at any one time. 2014-11-17 12:44:25 +02:00
4e405ebb8f Added logging to log rotation and to filter session setup. 2014-11-12 16:41:28 +02:00
f4576dbabc Merge branch 'develop' of https://github.com/mariadb-corporation/MaxScale into develop
Conflicts:
	log_manager/log_manager.cc
2014-11-12 14:59:36 +02:00
780733f870 MAX-325, Log rotation functionality. When skygw_log_rotate is called, corresponding logfile's rotate flag (lf_rotateflag) is set and log writer thread is woken up. Writer opens a new log file and closes the old one. 2014-11-12 14:48:17 +02:00
624c347984 Fixed compilation errors due to declaring variables after a goto command. 2014-11-12 10:24:21 +02:00
8af97016bb Dummy for skygw_log_rotate. 2014-11-11 18:33:17 +02:00
20ddcfb8c4 Fix to bug #613, http://bugs.skysql.com/show_bug.cgi?id=613
Simple fix: disable logging to files where logging fails.
2014-11-10 13:50:24 +02:00
4f39828fa1 Fixes to Coveriry issues 72757 & 73266 2014-11-07 10:07:22 +02:00
00fded016b Fixes to Coverity tasks : 73267, 72686, 72672
Cleaned up warnings, and added checks to malloc return values and error log writes in case of failures.
2014-10-31 15:25:59 +02:00
5b80cf3032 If opening any of the log files fail, MaxScale doesn't start before the cause has been removed. Added informative error message which is to be printed to standard error output. 2014-10-30 21:19:26 +02:00
7048270062 Coverity : 72678, 72687, 72689
Fixed memory leaks and use of freed memory
2014-10-30 18:19:41 +02:00
9d466b5770 Coverity : 72737, 72751, 72754
Fixed uses of uninitialized values.
2014-10-30 17:51:29 +02:00
32575e3fc0 Merge branch 'develop' into shm_log_fix
Conflicts:
	log_manager/log_manager.cc
2014-10-15 21:26:03 +03:00
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
5c968c9ac8 Merge branch 'develop' into shm_log_fix 2014-10-10 07:02:22 +03:00
29e53e150a Fix to bug # 565, http://bugs.mariadb.com/show_bug.cgi?id=565
Client flags are now copied to each backend and used in their connections.

log_manager.cc: fixed string allocation where one byte was missing.
mysql_client.c: fixed string allocation where one byte was missing.
2014-10-08 22:27:28 +03:00
194ebcb054 Fix to bug 567(http://bugs.mariadb.com/show_bug.cgi?id=567)
log_manager.cc: if the file exists, is a symbolic link and is not writable, the log manager does not fail but unlinks it and creates a new one.
2014-10-06 15:13:18 +03:00
856448500e Merge branch 'develop' of https://github.com/mariadb-corporation/MaxScale into develop 2014-10-01 14:38:15 +03:00
b0683d9b4d Updated the licensing year from 2013 to 2013-2014 2014-10-01 14:37:12 +03:00
a53e80e144 Added back removal of double newline character from log records. 2014-10-01 14:30:59 +03:00
52c0d0c768 Merge remote-tracking branch 'origin/develop' into header_rename 2014-10-01 05:24:02 +03:00