Commit Graph

9254 Commits

Author SHA1 Message Date
a10b93515e Simplify initialization of replication
The users are now created on both the slaves as well as the master. This
allows static binlog coordinates to be used on the slaves and the
replication initialization boils down to a set of SQL queries.
2017-12-19 16:44:46 +02:00
c3fe8a6b55 MXS-1565: Invalid rejoin test
- 1 master, 3 slaves
- stop maxscale so it does not autorejoin later on
- stop & reset slave on servers 3 & 4
- add data to server 4
- restart maxscale, check that server 3 is rejoined but not server 4
- manually set server 1 to replicate from server 4, creating a relay master
- check that servers 2 & 3 are redirected, making server 1 just a slave
- switchover master to server 1, check that it's the master

Also, moved some common functions into their own files. These functions
are used by multiple tests.
2017-12-19 15:59:01 +02:00
2a9619dd07 Add fail/switch/rejoin info to release notes 2017-12-19 15:22:42 +02:00
34bb02062d Use execute_query instead of try_query when failure expected
try_query will log an error unnecessarily.
2017-12-19 15:06:59 +02:00
628203213e Fix template generation
The templates weren't generated for Galera nodes.
2017-12-19 15:00:39 +02:00
4451355e47 Don't force verbose output
The tests shouldn't force verbose output.
2017-12-19 15:00:39 +02:00
3e398004e8 Update 2.2 ChangeLog, Release notes, and Upgrading doc. 2017-12-19 13:58:15 +02:00
7813be0972 Update MaxScale 2.2 version number 2017-12-19 13:51:17 +02:00
1006ec506a 2.2 fix restore (#152)
* refactor test backend fixing

* return comatibility with 5.5 for backend restore

* remove backend configuration scripts

* adopt test backed restore function for 2.2 test fw
2017-12-18 23:47:07 +02:00
b9e7eaf3aa Do not create std::string from NULL 2017-12-18 16:31:50 +02:00
5a612be394 Do not try to create a std::string from NULL 2017-12-18 16:25:41 +02:00
c4ba3ba4ca MXS-1561 Switchover to bad master
auto_failover=true
auto_rejoin=false

This test tests the following:

- Regular master-slave setup
- Create a table, insert some data
- Sync all slaves
- Stop a slave
- Insert some more data
- Sync remaining slaves
- Stop the master
- Expect the failover mechanism to pick a new master (server2)
- Bring up the slave
- Perform a switchover from server2 to server4
- Should fail

Currently it does fail, but only due to a timeout.

    [mysqlmon] MASTER_GTID_WAIT() timed out on slave 'server4'.

There should be some check that would ensure that the failure happens
faster than that.
2017-12-18 15:41:21 +02:00
033e3f628e MXS-1566 Rejoin old slave
This test tests the following:

- Regular master-slave setup
- Create a table, insert some data
- Sync all slaves
- Stop a slave
- Insert some more data
- Sync remaining slaves
- Stop the master
- Expect the failover mechanism to pick a new master
- Bring up the slave
- Expect the slave to be rejoined
2017-12-18 14:36:47 +02:00
7ed9172496 MXS-1533: Rejoin also when the old master cannot be connected
Previously, the rejoin would only be ran on servers with a connected slave io
thread. This patch runs the rejoin also on slaves which cannot connect to a
downed old master while the master hostname or port differs from the current
cluster master server.
2017-12-18 13:04:47 +02:00
2c46e2a7ec Ensure slave not running when reseting
With this change it is ensured that you do not see

  ERROR 1198 (HY000) at line 28: This operation cannot be performed
  as you have a running slave ''; run STOP SLAVE '' first

when the slave is reset.
2017-12-18 10:58:09 +02:00
e45653724e Update .gitignore 2017-12-15 13:51:46 +02:00
e33b2d0fcd MXS-1567 Rolling master promotion
- The test starts with the usual setup of 1 master and 3 slaves.
- Then the master is taken down and it is checked that the failover
  mechanism promotes some slave to master.
- This is continued until there is a single master left (no
  slaves).
2017-12-15 13:51:46 +02:00
5fc787a67c Add 'detect_standalone_master=true'
Only necessary for the two node case and not needed once the flag
is on permanently.
2017-12-15 13:51:06 +02:00
6b5ed66404 MXS-1564: Add rejoin test
The test combines auto-failover, rejoining a temporarily downed master
server and switchover.
2017-12-14 11:33:53 +02:00
2c131142c5 Update 2.1.12 release date 2017-12-14 10:50:13 +02:00
a62333a29a Assign the service pointer for backend DCBs
The backend DCBs didn't have a valid service pointer whereas the client
DCBs had one. The necessity of the pointer can be questioned as a similar
pointer is located in the session.
2017-12-14 10:50:13 +02:00
e2194a02ae fix wrong variable name in set_env.sh 2017-12-14 10:50:13 +02:00
db134fd314 copy to in the build script 2017-12-13 19:40:25 +02:00
b0272d83b1 fix generation of 2017-12-13 19:40:01 +02:00
b6e983c0b5 Change default value of detect_standalone_master
The default value was changed from false to true.
2017-12-13 13:18:44 +02:00
6d3e165bb0 fix log copying in Testconnections 2017-12-12 18:34:06 +02:00
dde85af83b Clean up mariadb_func.h
Combined functions into one which only used different default
values. Removed unused functions. Used std::string where possible to make
their usage easier. Hid code that isn't used externally.
2017-12-12 16:36:51 +02:00
fe75273874 Fix mxs431
The test was broken during the merge.
2017-12-12 16:36:51 +02:00
f0d33a6ead MXS-1560 Manual failover with two good candidates
Not two specific good candidates, but all slaves are assumed
are equally good.
2017-12-12 13:27:57 +02:00
3c2d03fd80 MXS-1559 Add skeleton test implementation 2017-12-12 13:27:57 +02:00
79afaa447e Merge branch '2.1' into 2.2 2017-12-12 13:23:02 +02:00
7ebd487ef3 change cnfs for binlog tests 2017-12-12 12:24:21 +02:00
6485365b3b MXS-1514: Split failover test in two files, add manual version
The same test now has two versions. In the automatic version failover
begins automatically. In the manual version failover is started with
maxadmin. The tests are otherwise identical.
2017-12-12 11:09:50 +02:00
06e16954c4 Add documentation for switchover, failover and rejoin 2017-12-12 10:44:13 +02:00
757ab3fd47 Increase mxs431 timeouts
The first timeouts don't appear to relate to the actual test but to
preparing it. Due to this, they can be increased by a great amount.
2017-12-12 08:53:19 +02:00
4b9bb9e65f Assign service pointer in BLR DCBs
The DCBs that were manually allocated by the binlogrouter were not
assigned the service pointers.
2017-12-12 08:47:02 +02:00
6b05d07c79 Update mxs431
Removed excessive output, tuned timeouts and removed unnecessary heap
allocation of TestConnections.
2017-12-12 08:47:02 +02:00
45ba9b3730 remove sha1check from *gtid tests due to lack of binlog files in the Maxscale cache 2017-12-11 16:12:42 +02:00
257112dc27 swithch to maxscale-system-test dir in the proper way before running test 2017-12-11 15:16:33 +02:00
66be882ae0 Don't reload users for dummy sessions
The service for a dummy session will be NULL. If authentication fails for
a dummy session, then no service level actions should be taken.

Only the binlogrouter can trigger authentication failure with a dummy
session as it creates connections before the service itself has started.
2017-12-11 12:31:40 +02:00
357eb67a84 Add missing configuration file for mxs1509
The test configuration file was not added to git.
2017-12-11 12:31:40 +02:00
6803ca2efc Fix crash in mxs361
The test crashed as it used the wrong result set field.
2017-12-11 12:31:40 +02:00
821d21dafb remove unnecessary 'cd' in run_test_snapsht (#148)
remove unnecessary 'cd' in run_test_snapshot
2017-12-11 12:17:13 +02:00
1ae05f0487 MXS-1514: Fix failover test
Current failover code better detects weird situations and refuses to work in one.
The test server slaves have events far ahead of the master in their binlogs,
causing the failover to stop. To fix this, slave binlogs are now deleted when
a test begins.
2017-12-08 12:39:47 +02:00
b29a8eb4f8 MXS-1513: Flush logs before tables during switchover_demote_master
In this order, the new binary log file will have 1 event instead of 0.
In total, only 1 event is added.
2017-12-08 12:28:50 +02:00
3c88bf1ec6 refactored tests (#147) 2017-12-08 12:23:04 +02:00
0ba7bdca81 Update connector-c to 3.0.2 for tests
Updated connector to same version that is used in MaxScale.
2017-12-08 10:39:49 +02:00
ca458cdce8 Update bug-list 2017-12-07 14:59:33 +02:00
8ed1ff67c2 Fix avro regression
The fact whether a query explicitly defined a query was ignored by the
statement parsing function and it always assumed the database was
explicitly defined. This caused the TABLE keyword in a CREATE TABLE
statement to be falsely identified as the current database.
2017-12-07 13:19:06 +02:00
7a6d00e807 Cherry-pick test fixes from 2.2
This is a partial cherry-pick of 9f11fdd2c122c9b30548c7ab55df8dda643ec659.

Use larger BLOB type for mxs812_1, the inserted value exceeds the normal
BLOB size.

Add a baseline check into bulk_insert to verify that direct connections
work (at the moment they don't, needs an investigation).

Modified avro_alter to prevent data type conversion errors.
2017-12-07 13:19:06 +02:00