Commit Graph

1497 Commits

Author SHA1 Message Date
1f241a5ed1 Rearrange libraries and build files.
This is the first change in an attempt to arrange the linking so that
more errors are detected at link-time.

- All files in server/core but for gateway.c are linked to one shared
  library called maxscale-common.
- The files log_manager/log_manager.cc and utils/skygw_utils.cc are
  built into maxscale-common as well.
- MaxScale itself consists now only of gateway.c and is linked with
  maxscale-common.
- All plugins link with maxscale-common.
- All executables link in addition with {EMBEDDED_LIB}.

After this change, the change (MXS-517) where query_classifier is the
only component that uses ${EMBEDDED_LIB} and the rest mysqlclient can
be made much cleaner.

After a few additional steps, all shared libraries can be linked with
the linker flags "-Wl,-z,defs", which directs the linker to resolve
all symbols. That will require that all shared libraries list all the
libraries they need, but will at the same time ensure that any
missing symbols are detected at link-time and not at run-time.
2016-01-22 23:26:17 +02:00
a61cedb1aa Fixed freeing of wrong pointer
The wrong pointer in server_free was used to clear the server parameters.
2016-01-22 18:55:54 +02:00
872d02db3e Finalized configuration processing cleanup
All parts of the configuration processing are now in their own functions.
This allows new objects to be created after MaxScale has started.
2016-01-20 09:25:03 +02:00
508c91be32 Cleaned up monitor configuration processing
Moved the monitor configuration processing into its own function and cleaned
it up.
2016-01-19 14:23:44 +02:00
53ac88a1a1 Cleaned up the process of adding filters and servers to a service
Moved the adding of filters, servers and router options to its own function.
2016-01-19 14:23:44 +02:00
0aaba891a3 Cleaned up server configuration processing
Moved the creation of new servers into a separate function and cleaned up
the configuration processing.
2016-01-19 14:23:44 +02:00
c6dfcb66f5 Cleaned up service configuration processing
Moved the allocation and configuration of services into their own function.
Moved SSL parameter validation into a separate function.
2016-01-19 14:23:44 +02:00
f12be9fea2 MXS-549: Change MaxScale's working directory on startup
MaxScale now changes the working directory to the log directory when it is
started. If this fails, the file system root is used instead.
2016-01-19 13:59:38 +02:00
c2310327fc Fixed idle session processing
The current implementation of idle connection timeouts is not safe. The sessions
are handled in a way which is not thread-safe and the checking is done from
a non-polling thread.

With this change, the checks for the session timeouts are done in one of the
polling threads in a thread-safe manner only if at least one service has enabled
the timing out of idle client connections.
2016-01-19 10:53:55 +02:00
cdeb921b1b Added missing freeing of monitor resources
Monitor servers were not freed.
2016-01-15 21:38:40 +02:00
c5947285cf Added missing freeing of filter resources
Filters were not freeing their options or parameters.
2016-01-15 16:24:32 +02:00
1656840417 Added missing freeing of service resources
The service resources weren't freed when the service is freed.
2016-01-15 16:23:41 +02:00
47f6c6613e Added missing freeing of server resources
The server did not release the parameters or the slave ID list.
2016-01-15 12:42:12 +02:00
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
b01e8b2eec Added utils library initialization function and improved replace_quoted
Currently the initialization function only prepares PCRE2 patterns for use.
Added the call to the new utils_init() function to MaxScale and all relevant
tests.

The replace_quoted now uses a shared PCRE2 pattern which should remove some
of the overhead of the function.
2016-01-11 17:04:39 +02:00
23ebd581dc Fix mistake in optimise-core branch, dcb.c. 2016-01-08 14:11:50 +00:00
bd02835139 Fiddle around with spaces. 2016-01-08 13:47:34 +00:00
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
4461cd9398 Streamline modutil_get_complete_packets code. No external impact. 2016-01-08 13:47:34 +00:00
aa79e61aac Various optimisations of bitmask processing. External change is that bitmask_clear() does not apply a spinlock, so must be called with exclusive access to the bitmask. This affects the call in shutdown processing in poll management. The call from DCB processing is safe because zombie processing has exclusive access to DCBs. 2016-01-08 13:47:34 +00:00
78b363aec7 Enhance buffer handling by changing gwbuf_free to free the whole list of buffers (although it could contain only one buffer). Add gwbuf_count to give number of buffers in a buffer list (for convenience in debugging). Add gwbuf_alloc_and_load to simplify putting data into a new buffer. 2016-01-08 13:47:34 +00:00
4ef89d213b MXS-463: Filepaths are now properly formatted for printing
The various global directory setter functions now process the input they receive
and remove redundant and trailing forward slashes from the directory paths.
2016-01-04 18:40:00 +02:00
080a9ebc9d PCRE2 is now statically linked
Since the PCRE2 library was always going to be a part of MaxScale, there was
no real reason to have it as a shared library apart from smaller binaries.
2015-12-29 10:09:38 +02:00
2b6b8f87db Fix to MXS-183: Fixed wrong pointer being used for logging error message
The wrong pointer was used when logging an error message about a bad parameter.
2015-12-23 12:46:08 +02:00
8d969aadd1 Changed default number of threads and added auto value.
Changed default number of threads to 1 instead of autoconfigured value and
added a new `auto` variable which enables autoconfiguration of thread count.

The number of threads used when autoconfiguratio fails was changed from 4 to 1.

The default value of using N threads where N is the number of CPU cores was
not optimal as the possibility of rescheduling was higher the more utility
threads there were. Due to this, N-1 is deemed to be the better autoconfigured
value for thread count.
2015-12-15 15:08:43 +02:00
78b5777d6e Fixes to Coverity defects
Few fixes to possible use of freed memory and resource leaks.
2015-12-15 13:13:53 +02:00
edb3f3efd5 Fix coverity report of config.c
If pointer uninitialized there can be free of unallocated memory.
2015-12-08 10:28:31 +02:00
e3e8a59555 Allow hangup event also when EPOLLRDHUP is not available.
When generating a fake hangup event, EPOLLRDHUP is used if available,
otherwise EPOLLHUP. process_pollq(int) does the same thing both in the
case of EPOLLRDHUP and EPOLLHUP, so it seems this should work.
2015-12-08 10:14:10 +02:00
a71cab166b Fix coverity report of gwbitmask.c
Buffer overrun. A byte is needed for the terminating null.
2015-12-08 09:33:04 +02:00
dbc321df9b Fix coverity report of externcmd.c
Buffer overwrite.
2015-12-08 09:32:10 +02:00
6870d77acb Fix set_user prototype. 2015-12-07 14:14:42 +02:00
f62ff4c551 Fixed spelling mistake in usage output.
Path was spelled as apth.
2015-12-04 17:47:14 +02:00
d054cb1595 Correct logic errors in bitmask_set and extend initial/increment size to reduce likelihood of any risk of realloc failure. 2015-12-01 15:16:12 +00:00
74bb291961 Reindent server/core/monitor.c 2015-12-01 09:40:07 +02:00
b2dd24ada3 Reindent server/core/utils.c 2015-12-01 09:32:31 +02:00
fbecf128dd Reindent server/core/users.c 2015-12-01 09:29:52 +02:00
8bbc3e8086 Reindent server/core/thread.c 2015-12-01 09:29:03 +02:00
a95be21266 Reindent of server/core/spinlock.c 2015-12-01 09:28:19 +02:00
15df33a93f Reindent server/core/session.c 2015-12-01 09:26:26 +02:00
8601068dc2 Reindent server/core/service.c 2015-11-30 21:25:10 +02:00
ed06d4f14c Reindent server/core/server.c 2015-11-30 19:47:29 +02:00
0aa38cad4c Reindented server/core/resultset.c 2015-11-30 18:58:43 +02:00
6c401b9085 Reindent server/core/poll.c 2015-11-30 18:57:19 +02:00
c0615408aa Reindented server/core/modutil.c 2015-11-30 18:53:42 +02:00
17eb80072f Reindent server/core/secrets.c 2015-11-30 18:48:14 +02:00
233f50f3e6 Reindent server/core/random_jkiss.c 2015-11-30 16:04:18 +02:00
72dd159f98 Reindented server/core/memlog.c 2015-11-30 15:18:51 +02:00
60fb05ea40 Reindented server/core/load_utils.c 2015-11-30 15:17:36 +02:00
3189a47fc5 Reindented server/core/housekeeper.c 2015-11-30 15:16:44 +02:00
486f724dc1 Reindented server/core/hint.c 2015-11-30 14:10:15 +02:00