Commit Graph

2002 Commits

Author SHA1 Message Date
8be44a8cda Merge branch '2.1' into develop 2017-03-06 11:25:44 +02:00
e7b5731976 Fix internal test suite
Two of the tests didn't initialize the random number generator.
2017-03-06 11:06:33 +02:00
bb22b82461 Merge branch '2.0' into 2.1 2017-03-06 10:38:07 +02:00
dadc0d6a9d Fix DATETIME and BLOB processing
The old DATETIME format wasn't processed properly which caused a
corruption of following events.

A BLOB type value could be non-NULL but still have no data. In this case,
the value should be stored as a null Avro value.
2017-03-04 00:26:51 +02:00
7f9fdd0f3d Add router template
Using the class RouterSession and the template Router, a router
module can be defined. The way they are intended to be used are
as follows:

  class MyRouterSession : public maxscale::RouterSession
  {
      ...
  };

  class MyRouter : public maxscale::Router<MyRouter, MyRouterSession>
  {
      ...
  }

  ...

  extern "C" MXS_MODULE* MXS_CREATE_MODULE()
  {
     static MXS_MODULE module =
     {
         ...
         &MyRouter::s_object,
         ...
     };

     return &module;
  }
2017-03-03 15:30:25 +02:00
b3e8ea9b5a Merge branch '2.1' into develop 2017-03-03 13:37:14 +02:00
76e56a2688 Perform SSL cleanup 2017-03-03 13:28:27 +02:00
7b67cfd1ef Variables written to in signal handlers should be volatile 2017-03-03 09:41:56 +02:00
3bafcae343 MXS-759: Attempt to create PID directory
When MaxScale is started, it will attempt to create the PID directory. If
the directory does not exist and MaxScale is able to create it, MaxScale
will successfully start whereas it previously failed to do so.

If MaxScale lacks the permissions to create the directory, an error
message is printed to the user explaining the reason why MaxScale fails to
start.
2017-03-02 13:50:31 +02:00
18ee9114db [Je|T]malloc libraries must be first
If alternative malloc implementations are to be used, their
library must appear first on the link line.
2017-02-28 20:28:25 +02:00
fd92d76f0a Avoid accessing tls data
The thread id is copied to a local variable to avoid having
__tls_get_addr from unnecessarily being called over and over
again. Together that used to amount to some 1% of the execution
time.
2017-02-28 20:28:25 +02:00
65457f1724 Remove support for session specific log priorities
No need to maintain information in thread local storage,
which just added complexity and also incurred a slight
performance penalty.
2017-02-27 14:41:01 +02:00
bf4d00d6e3 Add temporary fixes to hashtable
These fixes prevent loops turning into eternal loops when
optimizations have been turned on.

The right remedy is to remove the internal locks from hashtable
and use external locks instead.
2017-02-27 13:36:51 +02:00
4e223adeff Simplify DCB writing code
Due to the changes in the threading model, the DCB write code can be
simplified by a great amount.

Since only one thread can write to a DCB, it's safe to assume that no new
data is added to the write queue of a DCB while it is being drained. This
removes the need for the code that tracks whether a concurrent DCB write
attempt was made.

Because the high and low water callbacks weren't used by any module, it is
safe to remove them. They offer no real benefits over the drain callback.
2017-02-27 09:25:15 +02:00
1d8d526a01 Merge branch '2.1' into develop 2017-02-20 18:39:41 +02:00
61f2d96a58 Merge branch '2.0' into 2.1 2017-02-20 11:17:49 +02:00
f54c0a5b81 Initialize RNG in maxkeys/maxpasswd
The initialization needs to be done in each of the executables before the
random number generator is used.
2017-02-20 11:07:44 +02:00
71707c8505 Merge branch '2.1' into develop 2017-02-15 08:48:36 +02:00
49cc2b52e3 Merge branch '2.1.0' into 2.1 2017-02-15 08:44:55 +02:00
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
0838401b32 Merge branch '2.1' into develop 2017-02-14 17:54:27 +02:00
2a49cd6451 getCapabilities now get the instance as argument
Allows the capabilities to be different depending on how the
filter/router has been configured.
2017-02-14 13:55:22 +02:00
5f0346f5a9 Remove support for session specific log priorities
No need to maintain information in thread local storage,
which just added complexity and also incurred a slight
performance penalty.
2017-02-14 12:35:24 +02:00
20da2c7db8 Add mxs_strerror
Thread-safe version of strerror; thread local buffer used for storing
the message. The performance penalty of a thread local buffer is not
likely to be significant, since this is only called in an error
situation that anyway is likely to interrupt the normal processing.
2017-02-14 09:39:03 +02:00
f7cc548093 Format mysql_binlog.c
The lines were too long.
2017-02-13 16:23:26 +02:00
7a35ec71da Fix DECIMAL conversion
The DECIMAL type was not correctly converted to positive integers. The
0x80 bit was set only for negative numbers when it needed to be XOR-ed for
all values.
2017-02-13 16:23:26 +02:00
f9732d7041 Fix DECIMAL handling in Avrorouter
The DECIMAL value type is now properly handled in Avrorouter. It is
processed into an Avro double value when before it was ignored and
replaced with a zero integer.

Backported to the 2.0 branch.
2017-02-13 16:23:26 +02:00
fdc66c660c Require that thread_data can be allocated
The allocation of the thread_data that is populated by the polling
mechanism must now succeed, or the process will exit. It's very
unlikely it would ever fail and it is unlikely MaxScale could would
function if it it did fail. Consequently, checks for its validity,
which anyway weren't done correctly everywhere, could be removed.
2017-02-13 15:37:05 +02:00
acd66b4eb3 Fix compiler warnings
Added missing checks for return values of various function calls. Fixed
binlogrouter strerror_r usage and wrong buffer sizes.
2017-02-13 11:44:38 +02:00
cf63e4cb9e Remove false debug assertion
If MaxScale is started without the appropriate permissions to the paths
pointed by default values, the debug assertion fails even though the
parameter is valid but not usable.
2017-02-10 18:49:22 +02:00
d2c3be8728 Fix compiler flag usage
The compiler flags overwrote the default values that CMake generates
instead of appending to them.
2017-02-10 17:19:46 +02:00
04b2475553 Fix random_jkiss initialization
The initialization function used another function which expected
initialization to be done.
2017-02-10 14:17:54 +02:00
334e71b079 Initialize random number generator in main
The random number generator can be initialized when MaxScale's other
systems are being initialized. This removes the need to initialized it
when the function is used for the first time.
2017-02-10 13:02:39 +02:00
fb21b99983 Fix DATE and DATETIME months
The month values for DATE and DATETIME were off by one.
2017-02-09 16:50:14 +02:00
54d4a562ce Merge branch '2.1' into develop 2017-02-09 15:07:13 +02:00
d76be99cc5 Improve error message
A parameter may be wrong because the parameter name is wrong or
the value of the parameter is wrong. That needs to be reflected in
the error message.
2017-02-09 15:02:34 +02:00
ce5cd69eb3 Remove unused locks and variables
Removed unused spinlocks from DCBs, sessions and the MySQL protocol
structs. They were used in a context where only one thread has access to
the structure.

Removed unused member variables from DCBs.
2017-02-08 15:31:17 +02:00
517ecd9a12 Remove unnecessary spinlocks from random_jkiss
Removing the locks will increase the randomness of the random number
generation by introducing race conditions into the code.
2017-02-08 14:39:16 +02:00
5cd29c4220 Merge branch '2.1' into develop 2017-02-08 09:32:18 +02:00
a6698c6f07 Merge branch '2.1.0' into 2.1 2017-02-08 09:30:34 +02:00
67888f3596 Merge branch '2.0' into 2.1.0 2017-02-08 09:27:00 +02:00
906a42d9a8 Use dcb_foreach inside dcb.c
All DCB listing code should use dcb_foreach to list them.
2017-02-07 10:21:58 +02:00
c6e1705f8d Add diagnostic entry point to authenticators
The authenticators should have a similar way to print diagnostic
information as filter and routers do. This allows the authenticators to
print the users in their own format.

In the future, all the diagnostic entry points should be changed so that
they return a structure that contains the information in a standard
form. This information can then be formatted in different ways by other
modules.
2017-02-07 10:03:58 +02:00
acdde499ed Replace get_users implementation with new version
The get_users function now combines the functionality of the old get_users
and get_all_users. This removes large parts of similar code.

Removed the listener resources as MySQLAuth was the only one that used it.
2017-02-07 10:03:57 +02:00
e3bed424ea MXS-1123: Fix connection_timeout causing constant disconnections
In a configuration with multiple services, one with connection_timeout and
others without it, the connections to non-connection_timeout services
would get immediately closed due to integer overflow.
2017-02-06 23:03:57 +02:00
7c5e326dd5 Remove listing of persisted DCBs
As the DCBs are "owned" by threads and are handled without locks, no
cross-thread access to those DCBs should be done. Due to this, the show
persistent command for maxadmin has to be changed to show only the size of
the pool.
2017-02-06 10:29:10 +02:00
869e6ac950 Remove useless maxadmin commands
The commands did nothing.
2017-02-06 10:29:10 +02:00
e64a641bcd Merge branch '2.0' into develop 2017-02-01 09:35:13 +02:00
4e50f3e0cd Fix MXS_MODULE_PARAM_SIZE handling 2017-01-30 14:23:54 +02:00
1f9b18e3bc Split secrets.h to public and core + miscellaneous cleanup
Also, changed some function names to this_style from thisStyle. More of
this in later commits.
2017-01-27 15:33:52 +02:00