Commit Graph

54 Commits

Author SHA1 Message Date
98ab399e6e Changed sprintf calls to snprintf calls and fixed compiler warnings. 2015-08-18 10:50:48 +03:00
15262f3fbf Added new Make target for testing MaxScale's core parts.
This target doesn't need a running MaxScale and only executes core, log_manager and query_classifier unit tests.
2015-03-19 11:56:40 +02:00
d7da8c5297 Code cleanup 2015-02-16 09:21:11 +00:00
a9a9a6eae5 Small fixes to log_manager and query_classifier tests. 2015-01-30 08:26:10 +02:00
06c2d201e0 remove makefiles and other garbage 2015-01-14 19:08:24 +02:00
70eef7aaa8 Fix to bug #513, http://bugs.skysql.com/show_bug.cgi?id=513 2014-11-17 15:33:13 +02:00
474f018cee Fixes to minor Coverity errors:
75424
73422
72724
72702
72662
2014-11-07 11:12:26 +02:00
17f87e29af Fixes to some Coverity issues. 2014-11-05 11:57:42 +02:00
b0683d9b4d Updated the licensing year from 2013 to 2013-2014 2014-10-01 14:37:12 +03:00
f4e591e382 Changed 'SkySQL Gateway' to 'MariaDB Corporation MaxScale' 2014-09-30 13:15:03 +03:00
c344231f80 Renamed all occurences of SkySQL to MariaDB Corporation 2014-09-30 13:02:10 +03:00
3f0de666ac Changed the order of linking to resolve some debug build bugs and added the missing parent directory of the MYSQL_DIR into the included directories. 2014-09-20 19:44:30 +03:00
8b1afbfe26 fixed tests not working with the normal 'make testall' 2014-09-16 20:02:28 +03:00
41226692ac Merge branch 'release-1.0beta-refresh' into cmake_build 2014-09-16 12:11:17 +03:00
c8fc5b712b Merge branch 'hholzgra-hartmut-gitignore' into release-1.0beta-refresh 2014-09-15 13:22:46 +01:00
32b72ce474 more configuration options, README update and tests 2014-09-12 16:48:21 +03:00
d8c34aabad added log manager and query classifier tests 2014-09-12 06:06:11 +03:00
d35a73478e Added the actual output of log entry tests to the testing log. 2014-09-10 14:03:57 +03:00
aceae1c32b Removed the debug tags from log entries in standard debug builds and added a special switch to the tests 2014-09-10 13:00:28 +03:00
4028c50fea added state based block buffers to log manager 2014-09-10 12:09:00 +03:00
aa83b6b21a Changed the way blockbuffers are used after they fill up.
The blockbuffers that get full are now moved to the end of the list of blocks. This prevents messages being written to the disk in the wrong order.
2014-09-09 10:48:25 +03:00
2097b54c35 More debugging info 2014-09-08 14:49:52 +03:00
d7439b67c5 Added log order scripts and more debug output 2014-09-08 10:40:23 +03:00
4a9fb47699 fixed a division by zero error and enabled non-flush mode 2014-09-05 17:28:32 +03:00
bfac227f4d tests for log manager write order 2014-09-05 17:24:26 +03:00
c5fbb1f295 query_classifier.cc:parsing_info_done: calling mysql_thread_end caused segfauls when same thread tried next time call free_embedded_thd because thread's sysvar was set to NULL in mysql_thread_end.
Added a few lines to canonical query test's input script which are not handled correctly.
2014-08-25 22:17:21 +03:00
d355e07e2d gitignore cleanup
* ignore typical backup files created by common editors
* move general ignore rules like "*.o" or "depend.mk" to top level gitignore
* ignore executables and test directories in target dir gitignore
  as these are local and there's no general catch-all pattern for them
2014-08-18 09:39:29 +00:00
7b40c1ee70 Changed how MaxScale unit test works.
All tests are run by executing 'make testall' in root directory. As a result all directories which contain tests will be entered and tests executed.
After tests, each directory have a test log including the last run's logs only.
Created a global test log, which is specified in test.inc. Test logs from subdirectories are concatenated to this file.
2014-04-10 19:08:28 +03:00
e8ce2268e0 Test system for MaxScale.
Every test/makefile have the following targets:
 cleantests 	- clean local and subdirectories' tests
 buildtests	- build all local and subdirectories' tests
 runtests	- run all local tests
 testall	- clean, build and run local and subdirectories' tests

Tests for directory random_dir are always in its subdirectory, in this case in random_dir/test . If random_dir has subdirectories with tests, random_dir/child_dir, for example, tests of child_dir can be started from random_dir/test/makefile where make -C child_dir/test <test target> is called.

See MAXSCALE_HOME/test/README for further information.
2014-02-07 11:06:37 +02:00
41298a09df Bugzilla entry # 363:
skygw_thread_t and simple_mutex_t make own copy of name argrument. Changed init calls to both accordingly.
2013-11-27 10:51:45 +02:00
cd507f1461 log_manager.cc
blockbuf_get_writepos, when all existing buffers in blockbuf list are full, a new block buffer is created and added to the list. Adding to the list is done with mutex on hold. Mutex shouldn't be freed before the next iteration in while loop, which expects that bblist mutex is on hold. At the end of the function, removed an unnecessary debug assertion.

testlog.c
	Enabled more intensive write test. Replaced TRUE and FALSE with true, false, respectively.

skygw_utils.cc
	simple_mutex_unlock, added debug assertion to ensure that pthread mutex's user counter is always at least 0 (it goes negative in double free).
2013-10-10 16:46:51 +03:00
76de8f3758 log manager now spreads log writings 'down' so that LOGFILE_ERROR logs are duplicated in LOGFILE_MESSAGE, and in LOGFILE_TRACE, and LOGFILE_MESSAGE logs are duplicated in LOGFILE_TRACE. 2013-08-20 10:43:54 +03:00
a5dd900acb Added test cases for speading log messages 2013-08-19 12:58:36 +03:00
c2743e7543 Logfiles are ordered by their id as follows:
LOGFILE_ERROR   = 1
LOGFILE_MESSAGE = 2
LOGFILE_TRACE   = 4

What is written to file n, will be written to all files m, m>n. Applies to user log writes. Some internal messages are such that they apply to one specific file, such as enable/disable notifications.
2013-08-19 10:28:28 +03:00
43fb6b87f1 Enabled trace log in DEBUG=Y builds. Modified testlog-c accordingly. 2013-08-09 10:01:34 +03:00
0ad25ba3ab Added functions skygw_log_enable(logfile_id_t) and skygw_log_disable(logfile_id_t) to Log manager API. By calling them log writing to any of predefined log files can be switched on or off.
Added simple test to testlog.c
2013-08-08 23:38:00 +03:00
ee68633c22 Removed unnecessary line 2013-08-05 10:25:45 +03:00
cae4d38a7e Removed unnecessary argument from log manager commands because it is not used and it is always NULL. 2013-08-04 23:30:47 +03:00
7a6129861e Added timestamp to log file headers and to the beginning of each line. Removed additional line feeds.
Example:

SkySQL MaxScale Sat Jul 27 12:13:10 2013
------------------------------------------
2013 07/27 12:13:10  Loaded module testroute: V1.0.0
2013 07/27 12:13:10  Initialise debug CLI router module V1.0.1.
2013 07/27 12:13:10  Loaded module debugcli: V1.0.1
2013-07-27 12:14:30 +03:00
b566c41067 Log manager sometimes failed to flush after skygw_log_write_flush because log client signaled filw writer thread too early. Fixed so that write is done first and file writer is registered after that. Except in cases where skygw_log_flush was called. Then only flush is triggered.
Added a few trivial cases to test.
2013-07-26 23:06:12 +03:00
ff8b432943 Added run-time path to dynamically loadable libraries; '-Wl,rpath,$(DEST)/lib' to makefile. When compiling, use
make DEST=<path to library directory>
2013-07-26 19:20:06 +03:00
2f189cb153 Log manager erroneously wrote string termination character after every log message.
Added a few trivial test cases.
2013-07-26 15:21:54 +03:00
baed0e846f Changed log_manager to use block-siuze buffers instead of small write buffers. Added new test cases and added iterations. Added possibility to test with dummy disk write which sleeps constantly for 5ms instead of performing disk write. 2013-07-23 08:34:43 +03:00
6abd9dbdaa Added profile counters: writebuffer init, done, total and recycle counts. 2013-07-02 16:53:23 +03:00
d11741130d Changed log manager API to support variable length formatted log strings. New API is as follows:
/** No change in these */
bool skygw_logmanager_init(void** buf, int argc, char* argv[]);
void skygw_logmanager_done(void** buf);
void skygw_logmanager_exit(void);
int  skygw_log_flush(logfile_id_t id);

/** writebuf remains unused, but formatted string is now possible and in case 
 * of formatted string, arbitrary long argument list is supported too. Max 
 * length for a log string is defined to BUFSIZ, whose value depends on the 
 * system but typically is 4/8KB.
 */
int  skygw_log_write(void* writebuf, logfile_id_t id, char* format, ...);
int  skygw_log_write_flush(void* writebuf, logfile_id_t id, char* format, ...);

makefile.inc includes new CFLAG : SS_PROF, which is set if PROF=Y on make command line or in build_gateway.inc .
ss_debug.h includes corresponding ss_prof(exp) macro which equals to exp if SS_PROF is defined and to empty if in other case.

mlist_t now includes datadel function which is a callback and it is executed for mlnode_data on node exit.
2013-07-02 14:46:39 +03:00
5c271e1925 Fixed clean-up processes in cases where initialization fails arbitrarily in the middle of startup. Added four descriptive states : UNINIT, INIT, RUN, DONE for flat stucts inside logmanager. Flat structs always have the state which tells what needs to be fred, if any. 2013-06-27 16:43:01 +03:00
9630ae588e Fixed bugs and cleaned code 2013-06-27 12:18:25 +03:00
2b8c62a7da Added a few more testcases to increase IO and added debug printing for file handling. 2013-06-26 23:40:07 +03:00
b74423121f Removed references to epoll code. 2013-06-26 23:26:21 +03:00
c8831f0a89 I didn't know these even existed in bazaar. Now they are removed. 2013-06-26 23:18:36 +03:00