Commit Graph

3075 Commits

Author SHA1 Message Date
b84e739cfa All queries related to prepared statement are sent to the master
The preparation and closing of prepared statements was sent to all servers
even though the execution was always sent to the master. With this change,
all queries which interact with prepared statements are only sent to the master.

The sending of statement preparations to all servers is a problem when a
statement which depends on a database or a table is created and the DDL
statement which created that table has not yet been replicated to the
slaves.

In addition to fixing the aforementioned problem, this change should also
reduce unnecessary network traffic to slaves and improve the overall
performance of the prepared statements.
2016-01-08 11:16:30 +02:00
40cfe1a864 Merge branch 'release-1.3.0' into develop 2016-01-08 11:14:02 +02:00
2b83530ae9 Make dbfwfilter.c rows less than 110 character long. 2016-01-08 10:35:53 +02:00
d99cece151 Removed the 16 chars limitation for binlog file name
Removed the 16 chars limitation for binlog file name
2016-01-07 15:29:11 +01:00
5b91f98067 Removed the 16 chars limitation for binlog file name
Removed the 16 chars limitation for binlog file name
2016-01-07 14:36:52 +01: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
05a7f5759b Fixed thread safety issues in schemarouter and shardrouter
Fixed strtok being used in a multithreaded context and removed unused code.
2016-01-04 18:40:00 +02:00
3abcb52837 MXS-502: Server state changes are logged at notify level
When MaxScale perceives a state change in one of the servers it will log
an message into the log file stating the previous and the current state.
This will make it easier to analyze failures in the cluster.
2015-12-30 19:49:41 +02:00
901dfd23c0 Changed burst_size to long instead of unsigned long
Changed burst_size to long instead of unsigned long.
This way check burst_size > 0 is now effective.

Setting "burstsize" option in router_options may be required.
i.e.: burstsize=10M
2015-12-30 16:14:51 +01:00
9ba2e4b97e Changed burst_size to long instead of unsigned long
Changed burst_size to long instead of unsigned long.
This way check burst_size > 0 is now effective.

Setting "burstsize" option in router_options may be required.
i.e.: burstsize=10M
2015-12-30 16:14:13 +01:00
3c69e641b9 Fixed false backend authentication failures
It was possible that a backend server was doing authentication while the client
closed the session. The more connections the router created the more likely it
was. This caused unnecessary reloading of the database users and confusing error
messages.

With the implemented fix, there are additional checks for the session state
before the users are reloaded or error messages are logged.
2015-12-30 05:13:27 +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
0cf564aa0d Fix to MXS-508: Fixed username matching in regexfilter
The username matching was working as intended but the session's active value
was ignored when queries were being routed. This meant that both the username
and the IP address of the user were ignored and query replacement was always
done.
2015-12-29 09:57:27 +02:00
e9755ba2b6 Remove file from slave
The binlog file is now always opened when it is needed and closed
when we are finished with it. That will remove any potential
file concurrency issues between different threads dealing with
the same slave.
2015-12-29 09:47:37 +02:00
04f807290a Remove file from slave
The binlog file is now always opened when it is needed and closed
when we are finished with it. That will remove any potential
file concurrency issues between different threads dealing with
the same slave.
2015-12-29 09:42:09 +02:00
05fb07f996 Removed extra brace
Removed extra brace
2015-12-28 18:00:55 +01:00
4f8340f5b2 Changed behaviour for a slave requesting master_log_pos beyond binlog file size
Slave request for a log_pos behind binlog file size may result in a
disconnection or replication error:

if binlog file is latest one slave get disconnected otherwise an error
message is returned and replication stops
2015-12-28 18:00:52 +01:00
71212a824b Removed extra brace
Removed extra brace
2015-12-28 17:56:39 +01:00
0f51f9c714 Changed behaviour for a slave requesting master_log_pos beyond binlog file size
Slave request for a log_pos behind binlog file size may result in a
disconnection or replication error:

if binlog file is latest one slave get disconnected otherwise an error
message is returned and replication stops
2015-12-28 17:56:33 +01: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
aff3f66fa6 Fixed compilation error for slavelag.c
There was an extra parenthesis left when skygw_log_write was changed to
MXS_ERROR which caused the compilation to fail.
2015-12-23 06:45:28 +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
3d20beef8c Fixed possible memory leaks in dbfwfilter.c
Made some variables stack allocated so there is no change of memory leaking.
There was no real reason to allocate memory from the heap for the variables in
question since they did not need to persist outside the scope of the function.
2015-12-15 13:09:50 +02:00
3139be8e5a Fixed SHOW SLAVE STATUS showing obsolete slaves
If SHOW SLAVE STATUS was executed after DISCONNECT ALL it was possible that
some of the disconnected slaves were used when printing slave hosts.
2015-12-10 15:50:20 +02:00
000a044da6 Slaves are set to unregistered state once disconnected
It was possible that the same slave was disconnected multiple times
before the slave DCB was closed.
2015-12-10 15:50:20 +02:00
9a3aae64ce Replaced explicit closeSession calls with dcb_close
The closeSession entry point shouldn't be called directly and dcb_close
should be used instead.
2015-12-10 15:50:20 +02:00
49cf4089fc Make state-change logging conditional. 2015-12-10 15:50:20 +02:00
f49bd06a7e Reduce logging of binlog server
Only the true state changes of a slave - up-to-date -> catch-up
or catch-up to up-to-date - are logged.
2015-12-10 15:50:20 +02:00
43c5a495a2 Removed useless spaces
Removed useless spaces
2015-12-10 15:50:20 +02:00
3f31f5548d Addition of slave transition to catchup mode in logging
Addition of slave transition to catchup mode in logging
2015-12-10 15:50:20 +02:00
992d6fb3bc Fix to MXS-501: Tee filter and USE ... no longer hangs
Some of the data was not reset for the branch session when a query
was not duplicated which could lead to a hang. Also the COM_FIELD_LIST
duplicated to the branch session even though it doesn't change the
session state.
2015-12-10 09:56:06 +02:00
5ebdd6f47d Fix signed/unsigned problem in tee.c 2015-12-10 08:41:20 +02:00
a663a8ec5c Fix to MXS-500: Statement cloning is now properly handled
If a statement wasn't cloned for the Tee filter, the session would be closed
leading to a possible hang. Instead of closing the session when a statement
isn't cloned, it should not expect a response from that server for that statement.
2015-12-09 13:48:20 +02:00
231a620dc0 Remove >= 0 check from unsigned type. 2015-12-08 14:37:21 +02:00
1deea7f929 Remove unnecessary comparison.
It makes no sense to compare an unsigned integer for non-negativeness;
it won't ever be. router_instance.lastEventReceived is uint8_t.
On centos5 this causes a warning that thus ends the compilation.
2015-12-08 13:28:11 +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
89bdf179b7 Added newlines at the end of all files
Some files were missing newlines as the last character in the file, causing
errors to appear on some systems.
2015-12-08 09:23:55 +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
d6afe70c6f Fix to MXS-323: Routers properly handle client DCB errors
All routers now detect if a client DCB is passed to handleError and
take the appropriate action.
2015-12-02 18:01:14 +02:00
9da0c206bb Added missing brackets
Some curly braces were missing from readconnroute and some function declarations
were misaligned.
2015-12-02 13:36:18 +02:00
45abfeec2c Fix to MXS-494: Fixed readconnroute weight calculation
The calculation of weights used the actual amount of connections instead of
actual amount of connections + 1. This lead to the weight being effectively
ignored for servers with no connections.
2015-12-02 13:36:18 +02:00
91eba965fc Formatted readconnroute
Formatted readconnroute files according to the style guide.
2015-12-02 13:36:18 +02:00
7119ed817d Transaction safety default is off in binlog router
Transaction safety default is off in binlog router
2015-12-02 11:18:12 +01: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
2e127ef38e Fix to MXS-429: Missing parameter no longer causes a crash
If a server is missing a weighting parameter the default weight will be used.
2015-12-01 12:22:47 +02:00