5898 Commits

Author SHA1 Message Date
Esa Korhonen
257034bf3e Clarify master failure verification
The two previous functions were somewhat overlapping.
2018-01-23 16:14:50 +02:00
Markus Mäkelä
73f1005e7a Fix memory leak in test_users
Users were allocated but not freed. Same with the JSON objects.
2018-01-22 15:29:21 +02:00
Markus Mäkelä
bb1bfcb52b Fix memory leak in service parameter output
When the service parameters were converted into JSON, an array was created
that was not used.
2018-01-22 15:29:21 +02:00
Markus Mäkelä
ef53ded057 Fix test_atomic
As the function documentation states, the expected value must be read
again after a call to atomic_cas_ptr. This is due to the fact that if the
values are not the same, the __atomic builtin version will store the
current value into the expected value.

The new value given to the atomic_cas_ptr function was the address of the
new value, not the new value itself. The behavior of the atomic_cas_ptr is
what caused the test to pass on systeems that implement the __atomic
builtins. On older systems that do not implement it, the expected value
was never modified which caused the test to hang.
2018-01-22 15:29:21 +02:00
Markus Mäkelä
ccebf38bc0 Update test configuration files
Updated the REST API and MaxCtrl configuration files with new object
names. Updated tests with new object names.
2018-01-22 15:29:21 +02:00
Markus Mäkelä
05402208a5 Merge branch '2.1' into 2.2 2018-01-19 11:47:13 +02:00
Markus Mäkelä
753b97303a MXS-1606: Create maxscale_schema database if missing
The monitor will now also create the database if it is missing. Since it
already creates the table, also creating the database is not a large
addition.

Cleaned up some of the related checking code and combined them into a
simple utility function.
2018-01-19 11:34:25 +02:00
Johan Wikman
7c7190e0c4 Fix index overflow in masking filter 2018-01-19 09:55:20 +02:00
Johan Wikman
beac04b8e7 MXS-1616 Also use 'value' in partial matching
As you can create regular expressions that have a fixed length,
e.g. "....$", it makes perfect sense to replace using 'value' if
the length of the string matches exactly.
2018-01-18 09:48:38 +02:00
Markus Mäkelä
47184ea46d Fix build failure on Ubuntu 17.10
The sprintf calls failed due to a warning about possible buffer
overflow. Curiously enough, the same warnings do appear on Fedora 26 but
only when the calls are changed to snprintf.
2018-01-17 14:06:19 +02:00
Johan Wikman
c02da103d7 MXS-1615 Fix access of wrong argument
- Wrong argument accessed at command invocation. In debug mode
  leads to crash, in release mode probably leads to crash.
- Log result of reload.
2018-01-17 13:59:00 +02:00
Esa Korhonen
a4f6176ced Fix bug in printing switchover/failover module command info
The string constant passed to the register-function went invalid
once CREATE_MODULE() completed, causing random characters to be
printed.
2018-01-17 12:01:00 +02:00
Markus Mäkelä
c4df28f64a MXS-1416: Skip directory creation with --config-check
The log and data directories aren't created or checked when the
--config-check option is given.
2018-01-17 09:56:50 +02:00
Esa Korhonen
23f2c3b980 Better failover timing and redirection success is tested
Works similar to switchover.
2018-01-16 18:05:12 +02:00
Esa Korhonen
1d211ecee2 MXS-1511: QLA-Filter replace newlines in SQL-queries with custom strings
The config parameter 'newline_replacement' (defaults to 1 space " ") now defines
what to write to the log file when the sql-query has a newline sequence (\n, \r or
\r\n). If 'newline_replacement' is the empty string "", no replacing is done and
newlines are printed to file.

Also, adds the config parameter 'separator', which defines the string
printed between elements. Default value is ",".
2018-01-16 14:25:19 +02:00
Markus Mäkelä
5273cbada6 MXS-1600: Add case-insensitive matching to MySQLAuth
The authenticator now supports similar identifier matching as the MariaDB
server. The lower_case_table_names parameter explains its intended use
(case-insensitive identifier matching):
https://mariadb.com/kb/en/library/server-system-variables/#lower_case_table_names
2018-01-16 13:51:22 +02:00
Esa Korhonen
c2c898ee93 Fix formatting in MariaDB Monitor 2018-01-16 13:27:20 +02:00
Esa Korhonen
ff2ad05d0a Add manual rejoin command to MariaDB Monitor
The rejoin command takes as parameters the monitor name and
name of server to rejoin.

This change required refactoring the rejoin code.
2018-01-16 13:20:35 +02:00
Markus Mäkelä
0afe10ffb9 Merge branch '2.1' into 2.2 2018-01-16 09:47:49 +02:00
Dapeng Huang
454f195cb0 fix:cannot connect to maxinfo with python client 2018-01-16 09:02:03 +02:00
Dapeng Huang
2b653887a3 fix crash at execute empty flush command 2018-01-16 08:40:22 +02:00
Markus Mäkelä
ab44a941ab MXS-1575: Fix large DECIMAL value handling
DECIMAL types that were larger than 8 bytes were not handled
correctly. The current implementation only prints the lowest 8 bytes of
the integer part of the decimal.
2018-01-15 16:15:20 +02:00
Markus Mäkelä
9ca6d586d1 MXS-1575: Fix Avro schema versioning
The versions were not updated if the table was dropped and created again.
2018-01-15 16:15:20 +02:00
Markus Mäkelä
dbad6b737d Detect redundant table map events
When two identical tables are mapped into the same slot, the newer one is
ignored.
2018-01-15 16:15:20 +02:00
Markus Mäkelä
5e4b7ae7c7 Fix memory leak in avrorouter
The TABLE_MAP freeing function leaked memory.
2018-01-15 16:15:20 +02:00
Markus Mäkelä
f2771d5ad8 Remove obsolete message
The warning that a schema already exists is obsolete as mapped tables are
now always opened instead of being reused. This causes the schema checks
to be done for each mapped table.
2018-01-15 16:15:19 +02:00
Markus Mäkelä
a44e352f4f Fix default protocol module names for objects
If either a server or a listener was created at runtime, it would use the
old protocol module name and log a warning.
2018-01-15 16:14:50 +02:00
Markus Mäkelä
f167bc5f02 Update example configuration
Updated links and module names in the configuration. Also changed object
names so that they don't produce warnings. Removed redundant parameters
and tuned default monitor_interval to a slightly more reasonable 2000
milliseconds. Enabled automatic thread number configuration.
2018-01-15 16:14:50 +02:00
Markus Mäkelä
f6f34ad7e5 Fix debug build failure on CentOS 6
The build failed due to a comparison between signed and unsigned integers.
2018-01-15 16:14:50 +02:00
Esa Korhonen
14f1bbed51 NamedServerFilter: Deprecate message for legacy parameter use 2018-01-15 15:30:38 +02:00
Markus Mäkelä
f54038f378 Process module command output even on errors
The output generated by a failed call to a module command was previously
overwritten with the error messages stored in the module command
subsystem.

In the case of a failure, the proper procedure is to check if the output
generated by the module command conforms to the JSON API error
specification and if it does, combine it with any system generated error
messages. If the output does not conform, it is stored in the "meta" field
of the returned object. This allows all of the generated output to be
saved.
2018-01-10 15:08:06 +02:00
Johan Wikman
990ca48ddc Reduce worker output
Some MXS_NOTICE changed into MXS_INFO
2018-01-09 15:28:16 +02:00
Markus Mäkelä
6ee5307624 Only pre-seed asynchronous authenticators
Only asynchronous authenticators require the thread-specific loading of
users as the synchronous ones all share the same data. If the service does
not declare asynchronous capabilities at startup, the users are not
seeded. This prevents unnecessary loading of users at startup.
2018-01-09 13:59:12 +02:00
Markus Mäkelä
facecc2dcd Make sure double DCB closes are detected
Crashing after a double close makes sure it is properly detected in debug
builds.
2018-01-09 10:57:18 +02:00
Markus Mäkelä
e36e506f32 MXS-1418: Fix regression
Removing a server from readconnroute caused the connection to be closed if
it was a master server.
2018-01-08 21:49:19 +02:00
Esa Korhonen
5f4db64ac7 Better timing for switchover, check slaves for IO/SQL errors
Time elapsed is now properly tracked during a switchover. After slave
redirection, an event is added to the master. Then, the slaves are queried
repeatedly until they advance to the newest event. I/O and SQL errors are
also detected.
2018-01-08 15:23:25 +02:00
Markus Mäkelä
e5d9ca4af8 Check if master reference is disabled
If a Backend is closed, the associated DCB is no longer valid. This needs
to be taken into account when the stored master reference is used.
2018-01-08 12:14:30 +02:00
Markus Mäkelä
0416d66bcb Set query classifier with an absolute path in tests
Setting the query classifier with an absolute path makes it easier to
manage test setup without having to manually resolve the relative path to
the query classifier from the test source directory.
2018-01-08 09:41:24 +02:00
Markus Mäkelä
579dca0750 Log to stdout in unit tests
The log manager will log to stdout to work around directory and file
permissions.
2018-01-05 16:12:54 +02:00
Markus Mäkelä
3f78dbc923 Improve avrorouter assertion output
When an assertion fails due to an overflow of the event buffer, all
processed values for that event are dumped.

This commit also enables the assertions even for non-debug builds which
should speed up the elimination process for bugs in the avrorouter. The
overhead of doing this is minimal as the output is already gathered for
the INFO level logging.
2018-01-05 13:39:57 +02:00
Markus Mäkelä
e5b5303137 Initialize the query classifier in tests
The test initialization function now loads the query classifier.
2018-01-05 12:57:09 +02:00
Markus Mäkelä
ce1c45828a MXS-1575: Fix CREATE TABLE processing
The CREATE TABLE processing failed to identify the explicit database names
that were generated by mysqldump.
2018-01-05 12:50:39 +02:00
Markus Mäkelä
95ad3aa7df MXS-1543: Log a warning if STATEMENT or MIXED is used
If avrorouter suspects that statement based or mixed replication formats
are being used, it logs a warning.
2018-01-05 12:50:39 +02:00
Markus Mäkelä
e310bbbe53 Initialize query classifier in housekeeper thread
The query classifier was not initialized for the housekeeper thread. This
means that tasks could not use the query classifier and as the avro
conversion is done inside a task, it can't use it.
2018-01-05 12:50:39 +02:00
Johan Wikman
afaf890840 MXS-1596 Rename mysqlbackend to mariadbbackend 2018-01-05 10:01:50 +02:00
Johan Wikman
f129dd56be MXS-1595 Rename mysqlclient to mariadbclient
Documentation update will follow.
2018-01-05 10:01:50 +02:00
Johan Wikman
c39dab9434 Make protocol module HTTPD lowercase
Oversight when renamings were made.
2018-01-05 10:01:50 +02:00
Johan Wikman
bed0b850b1 Merge branch '2.1' into 2.2 2018-01-05 09:58:10 +02:00
Markus Mäkelä
a91b857a43 MXS-1593: Don't display stale status
As the stale status is not a real status bit and it's used to retain the
history of a master, there is no need to print it in any output. This
output will only confuse users now that the stale status will not be
cleared from masters that go down.
2018-01-04 15:02:24 +02:00
Markus Mäkelä
5c8c20abe4 MXS-1539: Also synchronize rate limitations
If a synchronous authenticator is used, the rate limitations are also
synchronous.
2018-01-04 15:02:24 +02:00