Commit Graph

9879 Commits

Author SHA1 Message Date
2be576da31 MXS-1703 Fix refactoring error in get_replication_tree()
Refactoring and removing explicit class pointer caused a local variable
to mix with a class field. This fix renames the local variable.
2018-03-16 14:31:40 +02:00
3af469a074 Merge branch '2.2' into develop 2018-03-16 12:54:09 +02:00
6afd57122d Merge branch '2.2' into develop 2018-03-16 12:39:55 +02:00
391ec78a0b MXS-1721 Destroy a filter instance only once
If two services referred to the same filter instance, it would
cause the filter to deleted twice at MaxScale shutdown with a
crash as the result.

Now when the services are deleted we just collect the unique
filter instances and then delete them after all services have
been deleted.
2018-03-16 12:00:18 +02:00
2178667245 MXS-1679 Check for existence of master before continuing failover checks
Seems to fix the issue with MaxScale detecting an old master down event.
2018-03-16 11:26:58 +02:00
dad8e5da59 Sync slaves after creating tables in rwsplit_readonly
The test should synchronize the replication to avoid replication lag from
breaking the tests.
2018-03-15 23:24:08 +02:00
07cca088c9 MXS-1717: Fix test regressions
Due to the changes done for MXS-1717, the bug673 test had to be adjusted
and a newline has to be printed after users_diagnostic is called.
2018-03-15 23:23:15 +02:00
d32db326e4 MXS-1703 Manual switchover, failover, rejoin to class methods
This allows privatising several public methods. Also, cleaned up
monitor start and stop a bit.
2018-03-15 13:45:14 +02:00
51188123c8 MXS-1703 Move cluster dicovery code to a separate file
Attempting to break the large main file to smaller chuncks.
2018-03-14 17:52:15 +02:00
693854bd15 MXS-1703 Move most fields/methods to private 2018-03-14 15:08:53 +02:00
5aeac621f9 MXS-1703 Most functions now moved to class methods
Cluster discovery functions still remain.
2018-03-14 15:08:53 +02:00
fb55ea6015 MXS-1703 Move monitor main loop + other entrypoint contents to class methods 2018-03-14 15:08:53 +02:00
3999bed3e2 MXS-359: Reset temporary table tracking on master change
When the master changes mid-session, the temporary tables are inevitably
lost. This could be avoided by routing temporary table creation to all
servers.
2018-03-14 14:34:49 +02:00
33e448fc78 MXS-359: Document interaction of master_failure_mode and allow_master_change
Added a paragraph that describes the expected behavior of the router when
both `master_failure_mode` and `allow_master_change` are enabled.
2018-03-14 14:34:49 +02:00
6a49f6ff0d MXS-359: Add test with master_failure_mode=error_on_write
Testing of routing behavior with master_failure_mode=error_on_write and
allow_master_changes=true. By sending an error instead of closing the
connection when the master fails, the connection can resume execution if a
new master becomes available.
2018-03-14 14:34:48 +02:00
62d4fa822d MXS-359: Test read-only mode and master replacement
Added test cases that verify that the functionality works as
expected. Also made Mariadb_nodes::change_master less verbose when one of
the nodes is down.
2018-03-14 14:34:48 +02:00
57b18cc0ce MXS-359: Reconnect with disable_sescmd_history if possible
If a session has not yet executed any session commands, it should be
possible to replace failed slave servers.
2018-03-14 14:34:48 +02:00
16f201beed MXS-359: Close failed backend if in read-only transaction
If the connection to the backend where a read-only transaction is being
performed fails, the Backend object should be closed for it. This fixes a
debug assertion in readwritesplit.cc:check_and_log_backend_state which
asserts that the failed connection must not be in use after the error
handling is done.

Also reordered the failing assertion and the accompanying error message so
that the error is logged first.
2018-03-14 14:34:48 +02:00
35b7ef35b7 MXS-359: Stop monitor before switching master
Stopping the monitor before changing the master is the closest thing to an
instant master switch.
2018-03-14 14:34:48 +02:00
dc48b8af4e Fix change_master function
The change_master function did not stop slaves on all servers before
reconfiguring them.
2018-03-14 14:34:48 +02:00
548c51c50d MXS-359: Fix mxs359_master_switch configuration
The test used the wrong parameter name.
2018-03-14 14:34:47 +02:00
8d7bff932b Add missing readwritesplit initialization
The wait_gtid_state variable was not initialized. In addition to that, the
routing would continue with a NULL buffer in some cases.
2018-03-14 14:32:03 +02:00
9f5d2244ea Merge branch '2.2' into develop 2018-03-14 14:30:50 +02:00
d7c1d76065 Merge branch '2.1' into 2.2 2018-03-14 14:29:56 +02:00
f5e2870c83 Rearrange tutorial sections
The sections are now ordered so that a later section always refers to an
earlier section and not the other way around.
2018-03-14 13:02:50 +02:00
bbe57a58cb Move server creation into a mini-tutorial
Combined the redundant documentation into a single document.
2018-03-14 13:02:50 +02:00
36c960a141 Add helper functions and default parameters
Added some helper functions into the MaxScale class and default parameters
into the connection creation functions. Also made the ip() function const
correct.
2018-03-14 13:02:50 +02:00
464d52453b Add disconnect as an alias for close_connections
This way both MaxScale and backend connections have the same function
names.
2018-03-14 13:02:49 +02:00
60ad1bccc5 Remove old tutorials
Removed obsolete tutorials.
2018-03-14 13:02:49 +02:00
ae49eb0cba Update links in Documentation-Contents.md
Updated links to point to the new tutorials.
2018-03-14 13:02:49 +02:00
91e13d2c9a Update MaxScale-Tutorial.md
Made the document more concise and added links to the download page. Made
the user grants easier to copy-paste and explained that they are used in
the following tutorials. Updated the links to the new tutorials.
2018-03-14 13:02:49 +02:00
fe2dfe03f4 Create combined read-write splitting routing tutorial
The read-write splitting routing tutorial is a combination of the two
different read-write splitting routing tutorials. As with the connection
routing tutorial, this should reduce the maintenance burden.
2018-03-14 13:02:49 +02:00
b4ac1b4d07 Create combined connection routing tutorial
The connection routing tutorial is a combination of the two different
connection routing tutorials. This should reduce the maintenance burden by
a significant amount.
2018-03-14 13:02:48 +02:00
2f95532efd Combine MaxAdmin tutorials
Combined all maxadmin related tutorials into one document. This removes
the duplication of documentation found in all tutorials.
2018-03-14 13:02:48 +02:00
b7d19a6670 Clean up connection routing tutorials
Wrapped lines to 80 characters, fixed minor differences and reworded
sections so that they are identical.
2018-03-14 13:02:47 +02:00
944d47167f Create mini-tutorials for monitor and server configuration
The tutorials combine the Galera and MariaDB monitor configuration as well
as the server configuration sections that were duplicated for all
tutorials. This should make the documentation easier to maintain.
2018-03-14 13:02:47 +02:00
2023ee4dc7 MXS-1713: Fix resultset collection code
The resultset collection was not detected early enough in the code which
caused partial results to be returned to the router.
2018-03-14 13:02:47 +02:00
ec1a4de480 MXS-1703 Some miscellaneous functions moved to class 2018-03-13 16:09:14 +02:00
2856b91077 Sync slaves before starting the test
Syncing the slaves should guarantee that the table exists on all servers.
2018-03-13 15:17:18 +02:00
a75ea27a96 Fix memory leak when backend authentication fails
If the backend authentication failed for a user, the buffer containing the
error packet would leak.
2018-03-13 14:32:38 +02:00
4ce4c0b4c7 Merge branch '2.2' into develop 2018-03-13 13:35:19 +02:00
050e27685e Add various build script documents
Added documents that were left over from the build scripts repo.
2018-03-13 11:37:10 +02:00
dad6a4f9bf Merge branch '2.2' into develop 2018-03-13 11:26:41 +02:00
ff13fa633e Update .gitignore 2018-03-13 11:15:44 +02:00
633b08ed0d MXS-1717 Show which listener users are coming from
Earlier, if a service had multiple listeners you would have had

   MaxScale> show dbusers MyService
   User names: alice@% ...
   User names: bob@% ...

That is, no indication of which listener is reporting what. With
this commit the result will be

   User names (MyListener1): alice@% ...
   User names (MyListener2): bob@% ...

Further, the diagnostics function of an authenticator is now expected
to write the list of users to the provided DCB, without performing any
other formatting. The formatting (printing "User names" and appending
a line-feed) is now handled by the handler for the MaxAdmin command
"show dbusers".
2018-03-13 10:25:42 +02:00
78123a0333 Merge branch '2.2.3' into 2.2 2018-03-13 09:32:08 +02:00
4d201d28ed Fix broken documentation link 2018-03-13 09:25:47 +02:00
b982458497 MXS-1679 Add more accurate error printing
The reason for rejoin failing should now be clearer.
2018-03-12 17:16:54 +02:00
b8bf0e4ba5 Add statement timeout to mxs1585
Timing out the statements and adding a LIMIT clause to the DELETE
statement should rule out backend server related problems. If the test
still times out, the problem is most likely in MaxScale.
2018-03-12 14:55:54 +02:00
5a62adc63e MXS-1678: Detect broken replication with Last_IO_Errno
This commit introduces changes that fix the relay master detection that
was broken by the merge from 2.1 into 2.2 by commit
1ecd791887994209eb29e56e1271f8c407cd0cdf.

In 2.2, the master server ID is used to detect whether a slave is actually
replicating from a master. The value is still displayed even if the slave
is not actively replicating from a master. The commit in 2.1 causes this
value to be stored unconditionally if it is available. By checking the
value of Last_IO_Errno and comparing it to a list of known error codes, we
know whether the slave is replicating properly.

The slave detection in 2.2 correctly identifies a broken slave with a
stopped IO thread. Due to this, the test case must be modified to check
that the relay master is not a slave if the IO thread is stopped.
2018-03-12 14:55:54 +02:00