5708 Commits

Author SHA1 Message Date
Markus Makela
b12a87ef04 Fix false error message in readwritesplit
The error message for failure to find master wasn't included in the new
master error logging.
2016-11-09 23:21:53 +02:00
Markus Makela
8d893b4e56 Reassing master reference after sorting backends
The master reference used by the readwritesplit sessions needs to be
reassigned if slave reconnection occurs. This happens because the
reference refers to a certain place in the backend reference array
instead of the actual backend reference and those places are mixed
when the array is sorted.
2016-11-09 23:21:47 +02:00
Markus Makela
7f500feb9d MXS-710: Fix regression
MaxScale would crash if two or more listeners used the same service and
one of the listeners failed to start.
2016-11-09 06:44:37 +02:00
Markus Makela
5d930585f9 Use TLS for connector connections
The monitors and services didn't use TLS when they connected to the
backend servers. Since there has been no proof of instability, TLS should
be enabled.
2016-11-08 15:21:58 +02:00
Markus Makela
83f3245f75 Improve master routing failure error logging
The error logging is now more detailed and tells why the connection is
being closed. This should help the user figure out what is happening when
write fails and the connection is closed.
2016-11-06 10:25:56 +02:00
Markus Makela
263688d3af Use proper server status macros in readwritesplit
Some of the master server status checks didn't check whether the server
was actually running. The macros in server.h should always be used instead
of manually inspecting the server status.
2016-11-06 07:03:07 +02:00
Markus Makela
3d4a7179c7 Prevent active readwritesplit sessions from connecting to a master
If a readwritesplit session is active, it should never connect to a new
master. This will lead to unexpected results as the session states aren't
consistent.
2016-11-05 11:31:06 +02:00
Markus Makela
c30d0dfc9d Add more error logging to DCB handling
If an illegal DCB close is done with a backend DCB, it will log the server
where it was connected. This allows us to know whether the DCB was
connected to a master or a slave.

Added more debug assertions to readwritesplit code. The DCBs should never
enter the DCB_STATE_DISCONNECTED.

Removed useless debug log messages. The messages usually just flood the
logs with no use to the developers.
2016-11-05 11:28:18 +02:00
Markus Makela
87e94f6bc6 Fix debug assertion on packet length in blr_master.c
A debug assertion failed due to a NULL buffer but a non-zero packet
length. This was caused by a missing reset of the packet length after
freeing the buffers.
2016-11-04 10:53:21 +02:00
Markus Makela
8f6c1bdd5b Add more error messages for unexpected situations
Some error messages were logged at INFO level and some had conditions that
prevent the logging. Removed these restrictions that an error situation is
always logged.
2016-11-03 10:16:46 +02:00
Markus Makela
3870b81244 Prevent unintentional reconnections to the master server
If a master_failure_mode was set to error_on_write, a reconnection to the
old master would happen after the following events:

- Master server fails and the connection is closed
- The master server recovers
- A slave fails and the connection is closed
- A replacement for the slave is searched

If these events took place, the master would be taken back into use with
an inconsistent session state.
2016-11-02 19:55:36 +02:00
Markus Makela
572d466fad Fix read-only mode error handling in readwritesplit
In read-only modes, readwritesplit would always continue even if an active
statement execution was in progress.
2016-11-02 12:12:36 +02:00
Markus Makela
37a2c8cecf Use new function name in blr_slave
The blr_file_use_binlog function no longer exists and blr_file_append
should be used instead.
2016-11-01 10:28:15 +02:00
MassimilianoPinto
7dd498f0b9 MXS-958: a new binlog file is created after CHANGE MASTER if there is… … no pending transaction
Binlog server is already configured: if there is no pending transaction
a new binlog file is created after CHANGE MASTER.

If as START SLAVE is issued replication starts as usuale.

If maxscale is restarted the replication starts using the new created
file.
2016-10-31 15:20:51 +01:00
MassimilianoPinto
69b8cef95c MXS-958: the specified binlog file is created in $binlogdir while configuring binlog server for the first time
While configuring binlog server for the first time, master.ini not
existent, the specified MASTER_LOG_FILE is created in the $binlogdir.

If START SLAVE command is not issued the replication can start after
restarting maxscale as the binlog file exists.
2016-10-31 15:14:23 +01:00
Markus Makela
7b4561e3f4 Fix COM_CHANGE_USER handling in MySQLBackend
When a COM_CHANGE_USER statement was executed, the new user credentials
were copied after the authentication message was sent. This caused the
COM_CHANGE_USER to always succeed the first time as it used the current
credentials. The user credentials would always lag behind by one.
2016-10-31 14:56:20 +02:00
Markus Makela
6835fe4db9 Use pre-2.1 freeing functions
The binlogrouter code used the new MXS_FREE macro from the 2.1 version.
2016-10-31 14:56:20 +02:00
Johan Wikman
5ca0c730a1 MXS-960: In BRL, accept passwords with "," in them.
strtok_r replaced with a function that ignores delims that appear
within any of the MySQL quotes.
2016-10-31 11:54:15 +02:00
MassimilianoPinto
01f3b35fad MXS-961: error in replication stream and checksum calculation
When checksum is in use and there is an error in replication stream
master connection the blr_terminate_master_replication has no effect.

MXS-961: The checksum detection calls
blr_master_delayed_connect(router); and connection is scheduled again.

The fix will break the main loop as soon as the error indicator byte is
seen and no other computation will be done (such as checksum)
2016-10-31 10:18:22 +02:00
MassimilianoPinto
0f68fa6028 Removing error messages while executing RESET SLAVE
Removing error messages while executing RESET SLAVE
2016-10-28 18:40:18 +03:00
Markus Makela
1388686fb7 MXS-957: Fix temporary table detection
Temporary tables which were created from joins with other temporary tables
weren't properly detected as CREATE TEMPORARY TABLE statements.
2016-10-26 17:36:48 +03:00
Markus Makela
367d4407db Fix build failures when using C++11
Some parts of the code weren't C++11 compatible and the build would fail
with newer compilers.
2016-10-24 12:47:05 +03:00
Markus Makela
d53a6d2899 MXS-942: Don't return information_schema as the parsed database
When a DESCRIBE <table> or a SHOW COLUMNS IN <table> query is done, the
actual query is performed on tables in the information_schema
database. This might be what actually happens on the backend server but
this information is not really useful when we need to know which database
the query targets.

By passing the actual table names instead of the underlying table names,
the schemarouter is able to detect where these statements should be
routed.
2016-10-24 12:31:44 +03:00
Markus Makela
8e9012f514 Add missing declaration to maxadmin
A variable was not declared before it was used.
2016-10-24 11:17:51 +03:00
Johan Wikman
7a988df5a0 MXS-955: Put back proper .maxadmin handling
Now MaxScale again supports having 'hostname', 'user', 'port' and 'passwd'
in the .maxadmin file in addition to 'socket'.
2016-10-21 12:26:13 +03:00
Markus Makela
f1acc1f451 Use the backend server charset
The default character set should be copied from the server so that
MaxScale appears to be the same. This fixes problems where utf8mb4
couldn't be taken into use because MaxScale would always send latin1 as
the server charset.
2016-10-19 15:40:50 +03:00
Markus Makela
b50e794be7 MXS-917: Only log an error if the master is in use
When the readwritesplit can't locate the master server when it's checking
the list of available servers, it logs an error if the original master
reference isn't in a valid state. This error should only be logged if the
server is in use but in an unexpected state.
2016-10-17 06:54:37 +03:00
Markus Makela
c470813762 MXS-831: Detect new_master events
The new_master events were mistakenly detected as lost_slave events.
2016-09-30 00:01:53 +03:00
Johan Wikman
fa2a667195 qc_sqlite: Handle a name like ``a. 2016-09-29 23:48:21 +03:00
Johan Wikman
ca76cb1576 qc_sqlite: Recognize backslash as escape character
Without this change, e.g.

    insert into t1 values('\'');

causes a buffer overflow and crash.
2016-09-29 22:50:18 +03:00
Markus Makela
4658a28965 Fix out of bounds read in avro_client_process_command
When the last transaction was queried, it caused an out of bounds read
when strstr was used on the raw data of a GWBUF.
2016-09-29 15:28:57 +03:00
Markus Makela
dcf55d4099 Fix possible out of bounds read in CDCPlainAuth
When the authentication string was decoded from hexadecimal to binary, it
was possible that an out of bounds read was done if the length of the data
was not an even number.
2016-09-29 14:57:44 +03:00
Johan Wikman
3d5cfee348 housekeeper: Copy data to prevent access of freed data 2016-09-29 09:34:54 +03:00
Johan Wikman
4df5431572 qc_sqlite: Reduce logging when query cannot be parsed
If a query could not be parsed and details about the query are
asked, we log an info level message instead of an error.
2016-09-28 17:49:27 +03:00
Johan Wikman
8f233d32cf Always update state of bref behind lock 2016-09-28 09:29:56 +03:00
Johan Wikman
8fc6f52eea Update ChangeLog 2016-09-26 18:18:02 +03:00
Markus Makela
997fe6b90b Add a fail-safe for active operation counters
If a backend is not in use but it is waiting for a result, the state
should anyways be cleared to keep the operation counters correct.
2016-09-26 09:29:44 +03:00
Markus Makela
dd65062531 Fix broken link lists and clean up tutorials
Some of the tutorials didn't follow proper Markdown formatting rules.
2016-09-26 09:23:11 +03:00
Markus Makela
649efb91b5 Fix broken upgrades on CentOS 7
The upgrade process removed the /var/lib/maxscale directory as the newer
version didn't use it. This can be fixed by installing an empty directory
into /var/lib/maxscale.
2016-09-23 16:40:03 +03:00
Markus Makela
e618370cdb MXS-875: Fix regexfilter matching
The return values of pcre2_match are now properly handled. A positive
match is a return value which is greater than or equal to zero. This fix
should give a small performance boost to as memory is no longer needlessly
allocated.
2016-09-23 14:43:03 +03:00
Johan Wikman
542666ed16 qc_sqlite: Remove leak
Previously a query like e.g.

    delete t11.*, t12.* from t11,t12 where t11.a = t12.a;

would cause a leak. The code for freeing that memory was present
but commented out because it used to cause a crash.

Now no crash appears, so it would seem that the crash was caused
by something else that no longer is present.
2016-09-23 11:26:48 +03:00
Johan Wikman
049f823d37 Update tag information 2016-09-22 13:50:57 +03:00
Markus Makela
97858c164d Update library dependencies
Libcurl was not listed in the list of required packages.

The tarball installation instruction did not list any of the required
libraries.
2016-09-22 12:38:58 +03:00
Johan Wikman
a8118b98b4 Further refine the tarball instructions 2016-09-21 14:26:15 +03:00
Markus Makela
0882541c80 Make the default directories configurable
The default directories can now be changed at build time. This allows
tarballs to look for libraries in a more sensible place.
2016-09-21 14:21:18 +03:00
Johan Wikman
4422cd87eb Update tarball installation instructions
The /var/[log|lib|run|cache]/maxscale directory must be created
manually.
2016-09-21 13:07:13 +03:00
Markus Makela
578f21e757 MXS-874: Clear closed state before reconnecting to a server
The backend reference states should be cleared when a reconnection attempt
is made. Should the creation of a new DCB succeed, the backend should no
longer be closed.
2016-09-21 11:15:57 +03:00
Markus Makela
bd60fbde7e Create dummy files in /var directories for tar.gz packages
These files allow seemingly empty directories to be installed on various
platforms. Some platforms had problems installing empty directories.
2016-09-21 11:11:24 +03:00
Markus Makela
f6888ef205 Install all /var directories
The /var/lib/maxscale directory wasn't installed and tarballs didn't have
any /var directories.
2016-09-21 09:41:00 +03:00
Johan Wikman
ba2cafc65e Update tarball instructions 2016-09-20 16:36:33 +03:00