Commit Graph

2025 Commits

Author SHA1 Message Date
60714135c4 Merge branch 'develop-MXS-544-merge' into develop 2016-03-07 10:17:17 +02:00
3cbfb6821b Cleaned up SIGTERM and SIGINT handlers
Changed fprintf to write since it is signal safe.
2016-03-07 10:11:50 +02:00
768ff24428 Ensure SSL_LISTENER structure is intialised to binary zero when allocated in configuration processing by using calloc instead of malloc. 2016-03-04 11:53:54 +00:00
b7904bffb0 Expose maxscale starttime.
Maxinfo needs access to the time MaxScale was started.
Now exposed in a way similar to the uptime.
2016-03-04 11:55:47 +02:00
51755aae0c Expose maxscale starttime.
Maxinfo needs access to the time MaxScale was started.
Now exposed in a way similar to the uptime.
2016-03-04 11:45:12 +02:00
9dc55735e7 Missing listeners are treated as warnings instead of errors
Missing listeners are no longer a cause for shutdown.
2016-03-04 10:58:12 +02:00
ab33515282 Fixed undefined servers being ignored
The missing server was logged but it was not considered an error.
2016-03-04 07:06:53 +02:00
d3da98b58f Merge branch 'MXS-544' into develop-MXS-544-merge 2016-03-03 21:39:39 +02:00
cb8ea84853 No errors were logged when a service has no listeners
The starting of a service without listeners would fail but there wouldn't be
any log messages about the reason of the failure. In addition to this, MaxScale
would try to restart the service periodically which would lead to unnecessary
error messages.

With this change, missing listeners for services are considered configuration
errors.
2016-03-03 15:57:08 +02:00
0ddb81ea16 Fixed threads=auto not working
The name of the parameter was compared to `auto` instead of the value.
2016-03-03 15:29:05 +02:00
76f06572ed Fix to multi-statement processing
Renamed is_mysql_comment_start to is_mysql_statement_end because it checks
whether a statement truly ends instead of just checking comment block starts.

The calculations for buffer length in readwritesplit now use the payload size
instead of the buffer size.
2016-03-03 10:44:11 +02:00
8b6595aa68 Improvements and fixes to strchr_esc_mysql
The C style comments were not ignored and the -- style comments
did not check for the trailing whitespace and made return values char*.

The creation of a stored procedure would prevent sessions from using
any of the slave servers because readwritesplit would interpret
the creation statement as a multi-statement query.

Parts of modutil and readwritesplit now compare pointers to pointers instead of
converting pointers to integers.
2016-03-02 21:34:22 +02:00
2a35312022 Cleaned up the usage of the connector library
The monitor permission checks didn't use the standard connection timeouts but
used hard-coded values. The config.c tried to connect to the embedded library
but since it is not used by it anymore, it always fails.
2016-03-02 21:27:34 +02:00
9bfef5c7c1 Improved multi-statement detection in readwritesplit
Now comment blocks and identifiers quoted with backticks are taken into
consideration when multi-statements are processed.
2016-03-02 21:27:34 +02:00
9b2748f50c Removed false warnings about readwritesplit parameter types
The warning was expecting the wrong return value and mistakenly interpreted that
the setting of the parameter failed.
2016-03-02 21:27:34 +02:00
8cf1479f79 Removed logging from SIGTERM and SIGINT handlers
The logging of messages in a signal handler is not safe and sometimes caused
MaxScale to hang.
2016-03-02 21:27:34 +02:00
52e1b24975 Rename and export MaxScaleUptime()
MaxScaleUptime() renamed to maxscale_uptime() and moved from
gateway.c (MaxScale main) to misc.c, which is included in the
maxscale_common library. That way the symbol will be available
at link-time and will thus not prevent the use of the linker
flags -Wl,-z,defs (resolve all symbols at link-time) when
linking a module that uses maxscale_uptime().
2016-03-01 21:23:03 +02:00
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
955187d9fa Improvements on pathname handling of maxkeys and maxpasswd
The default pathname for maxkeys was a hardcoded value and it didn't use
the default directory location functions. If encrypted passwords were used
nothing was written into the log.
2016-03-01 10:57:13 +02:00
bf24f18805 Merge branch 'develop' into MXS-544 2016-02-29 10:40:33 +02:00
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
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
b5b27740e3 Fixed wrong comparison being made when setting readwritesplit parameters
The comparison was done with strcmp but it was expected to return true on
success when in reality it returns 0 on success.
2016-02-26 18:06:46 +02:00
f8d74dd7e2 Cleaned up error logging for session creation failures
The old message logged the function name and thread ID which are not useful
to the end user. The thread ID should only be printed for debugging purposes,
not general error messages.
2016-02-25 18:52:22 +02:00
18526c28f6 MXS-589: Separated persistent and temporary data directories
Both the passwords and temporary files of the embedded library were stored
in the same directory. Now the directories are separated and the embedded
library uses the temporary directory. The datadir cleanup also now only
cleans up the temporary data directory.
2016-02-25 11:24:20 +02:00
13387485f6 Added 'auth_all_servers' to service parameters if it is defined
The schemarouter checks if the service has this parameter and if it
is not there, it is automatically enabled. The parameter was not
added as a qualified service parameter so the router couldn't see
the parameter as defined even if it was.
2016-02-25 09:32:04 +02:00
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
a61b70a810 Quick fix to see if we can overcome crash. 2016-02-24 15:18:44 +00:00
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
417380ab83 Added missing use_priority to list of valid parameters
This caused Galera node priority usage to always fail.
2016-02-23 14:48:55 +02:00
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
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
8e010d2367 Fixed wrong comparison being made when setting readwritesplit parameters
The comparison was done with strcmp but it was expected to return true on
success when in reality it returns 0 on success.
2016-02-22 11:05:34 +02:00
fec1ebe925 Removed restrictions on monitor timeouts
The monitor timeouts can now be larger than the monitor interval. This will
allow the combination of low monitoring intervals and large network timeouts.
If a network experiences some periodic lag, it is desirable to allow large
timeout values.
2016-02-19 09:57:15 +02:00
5cfe352a8a Remove inline from function definition. 2016-02-18 11:44:59 +02:00
47281d1c55 MXS-582: Moved to crypt_r
Replaced all calls to crypt with crypt_r.
2016-02-16 16:04:50 +02:00
6da0446df0 Made function parameters constant and added debug checks
The number of written characters is now checked and should be lower than
compared bytes. The parameters to the dbusers.c query functions are now const
where possible.
2016-02-16 11:16:41 +02:00
c4bcc4ce88 Table-level access to databases is now detected
Previously the users needed at least SELECT permission on the database level to
be able to connect with a default database through MaxScale. With this change,
the query that retrieves the database users has been changed to also include
table-level grants for users. This will allow users with grants to only some of
the tables in a database to be able to connect through MaxScale with a default
database.
2016-02-16 11:16:41 +02:00
e468132b8b Cleaned up user data queries
The queries are now created at runtime to allow for a more varied syntax. This
removes the need to have separate query strings for the standard mysql.user
table and for the MySQL 5.7 version of it. In addition to this, the exclusion
of the root user is now done at the same time which removes the need to manually
form the query string.
2016-02-16 11:16:41 +02:00
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
a628fdcb17 Added configurable executable file directory
This allows MaxScale to launch processes from the directory where
the `maxscale` executable is located.
2016-02-15 11:12:54 +02:00
d1ba050bfd Make housekeeper const correct. 2016-02-12 16:16:32 +02:00
62aa1ea5d7 Remove module to be freed from list.
When a module is unregistered, it must be removed from the list.
Otherwise, if explicit unregistering of a module is made, there
will be a crash at shutdown when all modules are unregistered.
2016-02-12 10:15:06 +02:00
cbd73e285a Cleanup signal disabling and enabling.
The act of disabling and enabling signals are now in separate
functions.
2016-02-11 11:51:05 +02:00
000579814e Make functions const correct.
- get_expanded_pathname
- print_log_n_stderr
- resoved_maxscale_conf_fname
2016-02-11 10:44:32 +02:00
cfefc046e9 Merge branch 'release-1.3.0' into develop 2016-02-11 10:23:00 +02:00
8a814fbec4 Make log_manager self-contained.
log_manager.h now includes all necessary header files.
2016-02-10 15:32:48 +02:00
38db155fef Make mlist a separate component.
Mlist is now made available as a separate component instead of
being a part of skygw_utils.
2016-02-09 17:31:15 +02:00
2692d1081c Add slist.
Slist removed from skygw_utils and added as a separate component.
Nobody seems to be using it, so it could also simply be removed.
Left in place for the time being.
2016-02-09 15:30:27 +02:00
adbc2074de Remove log_manager as a separate component.
Log_manager files are now in server/core and the log manager test
files in server/core/test. The directory log_manager is removed.
2016-02-09 11:17:31 +02:00