404 Commits

Author SHA1 Message Date
Markus Makela
d3da98b58f Merge branch 'MXS-544' into develop-MXS-544-merge 2016-03-03 21:39:39 +02:00
Johan Wikman
cb3213af63 server/include/poll.h renamed to server/include/maxscale/poll.h
Due to an include conflict between /usr/include/poll.h and
maxscale/server/include/poll.h the latter was moved to
maxscale/server/include/maxscale/poll.h.

Once 1.4 is out, all maxscale header files will be moved to that
same sub-directory. That will prevent include conflicts and also
make it easy to see which include files belong to maxscale and
which do not.
2016-03-01 12:56:39 +02:00
Markus Makela
bf24f18805 Merge branch 'develop' into MXS-544 2016-02-29 10:40:33 +02:00
Markus Makela
f03865f32a Cloned DCB authentication data was freed twice
This caused all Tee filter sessions to crash when the branch DCB was closed.
2016-02-27 13:05:44 +02:00
Markus Makela
f77afc6374 Fixed possible crash when draining writequeue
The write queue spinlock was released in dcb_write_tidy_up without first
acquiring it. This caused a crash when two threads try to interact with
the write queue at the same time.
2016-02-26 20:45:41 +02:00
counterpoint
c26b5a3dd0 Tidy earlier fix and apply another - both follow the principle of not removing the link from session to client DCB when dcb_close is called for client DCB. The close will not fully complete, but will be finalised when the session is freed. At this time, no DCBs will be referring to the session. These measures protect the dcb->data in the client DCB from being lost until the session is no longer needed. 2016-02-24 15:34:02 +00:00
counterpoint
a61b70a810 Quick fix to see if we can overcome crash. 2016-02-24 15:18:44 +00:00
counterpoint
5122777829 Try to fix problem if balancing free client DCB and free session so that auth data is always available and client DCB is not freed until session is ready to be freed. Also fix problem in auth logic. 2016-02-24 10:00:45 +00:00
counterpoint
395cbdc103 Simplify handling of "client data" by having a pointer to it only in DCB and not in session structure. Change name of session->client to session->client_dcb for greater clarity. Temporary free of client data in DCB, to be moved to authenticator when it becomes a module. Fix incorrect name of listener_alloc. 2016-02-23 11:13:21 +00:00
counterpoint
5077933e41 Fix bug in mysql_client.c (over optimisation of protocol setting); various clarifications and improvements re code review. 2016-02-22 11:05:02 +00:00
Johan Wikman
5cfe352a8a Remove inline from function definition. 2016-02-18 11:44:59 +02:00
counterpoint
866e91c088 Changes to improve robustness of SSL processing, separate it so far as possible from protocols. Separate the detailed mechanism of authentication from the MySQL protocol with a view to making it into a module later. 2016-02-15 09:29:07 +00:00
counterpoint
971d1d5de2 Redesign logic of SSL connections to work with status in client DCB instead of in the protocol. This eases the way to moving SSL logic out of a specific protocol (currently MySQL) so as to be available across any protocol. Also, some simplification. 2016-02-03 08:54:55 +00:00
counterpoint
8367d93746 Migrate SSL functionality out of service and into listener. Develop config handling accordingly, including making provision for SSL parameters in servers for future use in implementing SSL to backend servers. Some elements still to be tidied mainly in mysql_client.c - but that will be part of detaching the SSL authentication from the MySQL protocol. 2016-01-27 15:46:19 +00:00
counterpoint
5515c71988 Reapply MXS-504 changes subsequent to optimisation changes. Merge SSL processing into non-SSL processing so far as possible, correct usage of OpenSSL, simplify where possible. 2016-01-13 10:08:37 +00:00
counterpoint
23ebd581dc Fix mistake in optimise-core branch, dcb.c. 2016-01-08 14:11:50 +00:00
counterpoint
fb5fdb17db Switch bitmask_clear to be locking and offer bitmask_clear_without_spinlock for non-locking version, in response to review comments. Revert poll.c to use bitmask_clear (with locking) and amend dcb.c to use the non-locking version and to take advantage of the return of an indication of whether the whole bitmask is then clearn. 2016-01-08 13:47:34 +00:00
Markus Makela
78b5777d6e Fixes to Coverity defects
Few fixes to possible use of freed memory and resource leaks.
2015-12-15 13:13:53 +02:00
Johan Wikman
2afe60dd0e Reindent server/core/dcb.c 2015-11-30 12:42:13 +02:00
Johan Wikman
916ee5ff2a Rename some log concepts
The mxs prefix is now uniformly used with all log components.
2015-11-26 17:34:53 +02:00
Johan Wikman
a8535f42af Remove all traces of logfile_t
The earlier log file based approach for enabling and disabling
messages has now been completely replaced with the syslog priority
based approach.

Similarly as with log files before it is now possible to enable
and disable a log priority for a particular session, even though
it apparently has not been used much.

The local test-programs of the logging has got minimal attention
only to make them compile. They should get an overhaul as they did
not work before either.
2015-11-23 19:10:53 +02:00
Johan Wikman
910ddb99fd Reset sessionid upon exit.
Since the sessionid is now unconditionally set, it also needs to
be unconditionally reset.
2015-11-23 18:44:38 +02:00
Johan Wikman
62b0e5fab0 Session info always copied to tls
Maxadmin earlier gave the impression that you could change whether
messages for different log files could be specifically enabled for
a session. In practice that was true only for trace messages as the
session id and the bitmask telling what logfiles are enabled, were
copied to thread local storage only as far as trace messages were
concered.

The code for setting that information in place is quit short and
efficient, so there is really no reason not to do that always.
This also means that it always will be possible to get your hands
on the session object if there is a need for that.
2015-11-23 18:14:46 +02:00
Johan Wikman
6164b7f301 Fixed unsafe use of localtime
Since localtime is not thread-safe it should not be used in multithreaded
contexts. For this reason all calls to localtime were changed to localtime_r
in code where concurrency issues were possible.

Internal tests were left unchanged because they aren't multithreaded.
2015-11-19 17:17:16 +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
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
6b88b6b17f Merge branch 'develop' into MXS-329-develop-20151111 2015-11-13 07:48:59 +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
counterpoint
dee20fe077 Merge remote-tracking branch 'origin/develop' into MXS-329-develop-20151111
# Conflicts:
#	server/core/CMakeLists.txt
#	server/core/buffer.c
#	server/core/service.c
#	server/modules/filter/tee.c
#	server/modules/monitor/mysql_mon.c
#	server/modules/routing/binlog/blr.c
#	server/modules/routing/binlog/blr_slave.c
#	server/modules/routing/debugcmd.c
#	server/modules/routing/readwritesplit/readwritesplit.c
#	utils/skygw_utils.cc

- resolved.
2015-11-11 11:08:02 +00: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
5507624326 Fixed typo'd sizeof. 2015-10-29 18:19:05 +02:00
Markus Makela
c29858d215 Added a definition for the size of the SSL error message buffer and changed all buffers to use it. 2015-10-29 16:39:38 +02:00
Markus Makela
f819f164b5 Cleaned up dcb_accept_SSL and added missing logging. 2015-10-29 16:39:38 +02:00
counterpoint
482db5e84d User friendly bit mask display for DCB print; monitors to work via inserting hangups instead of callbacks. 2015-10-17 20:00:05 +01:00
counterpoint
57f5dd15bc Resolve problem of lingering backend database processes; alter MySQL monitor to insert fake events when backend server unavailable; fix problem with count of current connections. 2015-10-16 17:55:07 +01:00
counterpoint
d000af33f6 Remove obsolete function. 2015-10-13 16:21:17 +02:00
counterpoint
efc0c7420e Correct misplacement of decrementing current connections counter. 2015-10-13 16:19:24 +02:00
counterpoint
5c985b42ba Fix problem with persistent DCB disposal 2015-10-05 16:36:07 +01:00
counterpoint
d582c5880c Impose locking on dcb_call_foreach DCB callback mechanism. Add counters and maxima for DCBs and zombies to aid diagnosis. 2015-09-29 11:58:31 +01:00
counterpoint
2231d0870c Place checks in callback routines because DCB will not always contain a reference to a router session, and the associated data will be invalid in this case. 2015-09-25 12:17:18 +01:00
Markus Makela
2dfb9e3c11 Merge branch 'develop' into MXS-329 2015-09-24 17:59:36 +03:00
Martin Brampton
89667294b3 Fix exceptional cases in DCB dcb_call_callback and in MySQL backend gw_error_backend_event - close DCB and return. 2015-09-24 07:39:47 +01:00
Johan Wikman
3b19acd1de Write queue emptied in dcb_final_free.
NOTE: Invalid indentation for reduced conflicts with MXS-329.
2015-09-23 15:16:19 +03:00
counterpoint
7aa36b77ea Guarantee router session is present for call to clientReply; properly free callbacks; attempt to set all necessary values for dbusers; do more to ensure buffers freed. 2015-09-21 14:25:12 +01:00
counterpoint
88716c35fb Various changes to block loopholes in different cases and tidy up. 2015-09-21 09:23:22 +01:00
counterpoint
b8af047a25 Remove excessively tight conditions for selecting persistent connections, add more information to debug output when connection is rejected. 2015-09-18 11:03:23 +01:00
Martin Brampton
31c6666278 Ensure DCB for closing session does not become persistent; remove bref_was_not_in_use. 2015-09-17 14:38:56 +01:00
Martin Brampton
357c4bcae5 Add to or take from persistent pool only if server is running; add conditions to DCB close in read-write handleError to check backend reference was in use. 2015-09-17 12:53:59 +01:00
Markus Makela
fe9babe9ec Cleaned up code. 2015-09-16 10:22:29 +03:00