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.
The polling statistics collection used atomic_add to increment values. This
is not an optimal way to update statistical values. Moved to per thread
values which are summed up when they are read.
Moved the functions used to gather polling statistics to their own file and
created a specific data type for statistics.
Only the query classifier needs the functionality of the embedded
server, while the rest of MaxScale is content with the client
library or Connector/C.
This have now been rearranged so that query-classifier links with
the embedded static library and then explicitly exports its own
functions using the query_classifier.map linker script. That way
query classifier will use the embedded library, while the rest of
maxscale use the client library, and this without conflicts.
Currently, query_classifier is not linked to maxscale-common,
but executables must link to maxscale-common and query_classifier.
Earlier thread initialization was done in poll_waitevents(),
which was somewhat confusing, since the main thread also calls
into poll_waitevents().
Now there is a specific thread "main" function, which first
performs thread specific initialization and then calls into
poll_waitevents().
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.
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.
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.
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.
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.
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.