1589 Commits

Author SHA1 Message Date
Markus Mäkelä
8e2c7fd952 Merge branch '2.0' into 2.1 2017-05-10 09:12:42 +03:00
Markus Mäkelä
898bc3444e MXS-1216: Fix processing of long fixed strings
The fixed length string processing assumed that the string lengths were
contained in the first byte. This is not true for large fixed length
strings that take more than 255 bytes to store. This consists of
multi-byte character strings that can take up to 1024 bytes to store.
2017-05-09 14:46:39 +03:00
Markus Mäkelä
09349aaa22 Add missing string versions of MySQL commands
The STRPACKETTYPE macro was missing a number of the commands from the enum.

Added executed command byte value to readwritesplit info level log output.
2017-05-09 10:40:34 +03:00
Esa Korhonen
a418387d0a MXS-1218 Poll statistics changed to 64bit to avoid looparound
Statistics calculation, printing and MaxInfo are modified.
n_fds remains 32bit.
2017-04-18 13:14:47 +03:00
Markus Mäkelä
41a9663611 MXS-1191: Fix crash on column drop
When a column is dropped from a table with a schema that has more columns
than the row event has, avrorouter will crash.
2017-04-04 17:08:07 +03:00
Markus Mäkelä
0f2f9d48b7 Improve maxadmin help messages
The help messages are now more descriptive and have usage information in
them. This should help users use the commands without relying on the
online documentation.
2017-04-03 12:09:59 +03:00
Markus Mäkelä
cbc1e864d9 Use RFC 3986 compliant addresses in log messages
When log messages are written with both address and port information, IPv6
addresses can cause confusion if the normal address:port formatting is
used. The RFC 3986 suggests that all IPv6 addresses are expressed as a
bracket enclosed address optionally followed by the port that is separate
from the address by a colon.

In practice, the "all interfaces" address and port number 3306 can be
written in IPv4 numbers-and-dots notation as 0.0.0.0:3306 and in IPv6
notation as [::]:3306. Using the latter format in log messages keeps the
output consistent with all types of addresses.

The details of the standard can be found at the following addresses:

     https://www.ietf.org/rfc/rfc3986.txt

     https://www.rfc-editor.org/std/std66.txt
2017-03-31 14:12:58 +03:00
Johan Wikman
726610b67d Use 64-bit integers for statistics in rwsplit
Wraparound is not likely anymore.
2017-03-30 12:44:27 +03:00
Markus Mäkelä
b458b63756 Use IPv6 for created listeners
When listeners are created, use the default values of [::]:3306.
2017-03-29 17:14:39 +03:00
Markus Mäkelä
a19c0ed1f3 Log executed maxadmin commands on info log level
When maxadmin commands are executed, they are logged at the info
level. This should help when the admin interface is being debugged.
2017-03-20 11:10:55 +02:00
Markus Mäkelä
37dd561470 Add support for IPv6
Both the listeners and servers now support IPv6 addresses.

The namedserverfilter does not yet use the new structures and needs to be
fixed in a following commit.
2017-03-13 10:45:55 +02:00
Markus Mäkelä
b796967df8 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-03-13 10:45:54 +02:00
Markus Mäkelä
20d89717c7 Remove unused headers
The my_config.h headers are not used.
2017-03-09 13:02:23 +02:00
Markus Mäkelä
41ff01d16d Merge branch '2.0' into 2.1 2017-03-09 10:01:38 +02:00
Markus Mäkelä
d764bb9e1f MXS-1178: Fix master_accept_reads
The order of the servers in the service definition could break the
master_accept_reads functionality.

When the first server defined in the service is a slave, it will always be
picked as the first candidate for reads. The master would only be
considered as a candidate for reads if no previous candidate was
available. For this reason, the master_accept_reads only worked when the
first server in the list was the master.
2017-03-09 07:45:29 +02:00
Markus Mäkelä
fd2df3a863 Always open files with configured block size
If the Avro file already exists, it should be opened with the configured
block size instead of the default block size of 16 kilobytes.
2017-03-08 20:03:45 +02:00
Markus Mäkelä
b4d81ffe27 Use correct capability for schemarouter
The router should use RCAP_TYPE_CONTIGUOUS_INPUT as it parses the
statements.
2017-03-06 16:35:17 +02:00
Markus Mäkelä
bb22b82461 Merge branch '2.0' into 2.1 2017-03-06 10:38:07 +02:00
Markus Mäkelä
f2fc9b9d9f Add workaround for null value handling in Avro C API
The Avro C API fails to write bytes of size zero. A workaround is to write
a single zero byte for each NULL field of type bytes.

Also added an option to configure the Avro block size in case very large
records are written.
2017-03-04 10:12:18 +02:00
Markus Mäkelä
09df0acb00 Fix binlog rotation detection
The rotations of binlogs weren't detected as the file names weren't
compared.

Moved the indexing of the binlogs to the end of the binlog
processing. This way the files can be flushed multiple times before they
are indexed.
2017-03-04 00:31:07 +02:00
Markus Mäkelä
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
Markus Mäkelä
789c14197d Merge branch '2.0' into 2.1 2017-03-02 14:05:42 +02:00
Markus Mäkelä
e2869052bd MXS-1081: Fix VARCHAR field processing
The data length is stored in the field metadata instead of the data being
encoded as a length encoded string.
2017-03-02 13:14:07 +02:00
Markus Mäkelä
e01a6a0d58 Fix field name parsing
The fix to field name parsing didn't properly break the loop when the
backtick character was detected.
2017-03-02 13:12:45 +02:00
Markus Mäkelä
e4b4dad94a Add more debug assertions to avro row processing
The debug assertions check that the event pointer isn't moving beyond
allocated memory.
2017-03-02 13:11:52 +02:00
Johan Wikman
7bcb60aaa6 MXS-1077: Add missing close 2017-03-01 10:47:20 +02:00
Esa Korhonen
d617a0b7b9 Move testfilter, router etc to examples
Also changed Plugin devel manual to match. Modified roundrobinrouter
to use static_cast due to the change in router api definitions.
2017-02-28 17:51:48 +02:00
Esa Korhonen
37f80a7dd8 Plugin development manual
Plenty of additions and restructuring compared to the first version.
Add it to Documentation.
2017-02-28 17:51:12 +02:00
Markus Mäkelä
b2cd90bb08 Only use get_bref_from_dcb with backend DCBs
Altered the function to assert that the DCB is a backend DCB in addition
to the existing assertions for non-NULL backend reference on function
return.

Move the fetching of the backend reference after the type of the DCB is
inspected in handleError. This removes the need to handle the case where
the returned bref is NULL and the DCB is a client DCB.
2017-02-28 11:28:22 +02:00
Johan Wikman
cb380d09f8 Deprecate session specific log priorities
They are not particularly useful, they surely are not used
and impose a small cost for every event extracted from the
poll sets.

This commit only removes the maxadmin commands, subsequent
commits will remove the actual code.
2017-02-27 14:40:11 +02:00
Johan Wikman
d44e38b15b Remove deprecated logging functionality 2017-02-27 14:40:00 +02:00
Markus Mäkelä
677e8aaabf Remove spinlocks from readwritesplit
Spinlocks are no longer necessary as the threading model only allows a
specific thread to access the router session.
2017-02-27 11:02:58 +02:00
Johan Wikman
560bd1e507 Update MXS_ROUTER_OBJECT APIs
Now the type MXS_ROUTER_SESSION is used in MXS_ROUTER_OBJECT.
All routers updated accordingly.
2017-02-27 10:17:57 +02:00
Markus Mäkelä
61f2d96a58 Merge branch '2.0' into 2.1 2017-02-20 11:17:49 +02:00
Johan Wikman
49cc2b52e3 Merge branch '2.1.0' into 2.1 2017-02-15 08:44:55 +02:00
Johan Wikman
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
Johan Wikman
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
Markus Mäkelä
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
Markus Mäkelä
4bd743d3ce Use correct Avro function
The avrorouter used the 32-bit function to store 64-bit integers. This
caused incorrect values to be stored.
2017-02-13 16:23:26 +02:00
Markus Mäkelä
0b892c9714 Add missing newline to avrorouter output
The schema was not terminated with a newline.
2017-02-13 16:23:22 +02:00
Markus Mäkelä
10e74225c0 Add missing error detection
If the file fails to seek to the correct position, the indexing should
stop.
2017-02-13 16:18:43 +02:00
Esa Korhonen
7e23789364 Fix one last compilation error
Fix one ignored return value in Avro, caused compilation to fail.
2017-02-13 14:46:43 +02:00
Markus Mäkelä
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
Markus Mäkelä
eb1e163bdf Only update index file if file is flushed to disk
There's no point in indexing the file if it hasn't been synced to
disk. Any attempts to index the file will fail if the file still has an
open data block.
2017-02-12 04:38:24 +02:00
Markus Mäkelä
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
Markus Mäkelä
47a1cdad5d Fix binlog integer conversion
The binlog integers were stored as unsigned values instead of signed ones.
2017-02-09 16:01:03 +02:00
Markus Mäkelä
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
Markus Mäkelä
a6698c6f07 Merge branch '2.1.0' into 2.1 2017-02-08 09:30:34 +02:00
Markus Mäkelä
c82831cc10 Fix merge conflict
An old define name caused the build to fail.
2017-02-08 09:29:26 +02:00
Markus Mäkelä
67888f3596 Merge branch '2.0' into 2.1.0 2017-02-08 09:27:00 +02:00