63 Commits

Author SHA1 Message Date
Markus Mäkelä
d60e97dfa5
Make node startup more robust
The connection attempts to all nodes are done over a period of time to
cope with slowly starting servers.
2018-11-19 20:02:11 +02:00
Markus Mäkelä
29d96662eb
Add missing error message to check_replication
The version extraction could fail silently.
2018-11-15 14:24:41 +02:00
Markus Mäkelä
3092a744ed
Enable verbose output on Galera startup failure
If a Galera node fails to start, enabling the verbose mode prints the
output of each SSH command. This fixes the visibility of the log file
printing.
2018-11-14 16:23:47 +02:00
Markus Mäkelä
07231747bf
Print server logs on failure to start
When the MariaDB server exits with an error, the logs help explain why
that happened.
2018-11-14 16:23:47 +02:00
Markus Mäkelä
2650a9174e
Fix addition of galera config options
The options weren't properly set as the galera nodes used different file
names.
2018-11-14 13:08:27 +02:00
Markus Mäkelä
0355398425
Fix typo in unblock_node
The command is called ip6tables.
2018-11-13 16:48:03 +02:00
Markus Mäkelä
eb1bc0b768
Add more error logging to Galera checks
The reason for the failure is now logged.
2018-11-09 09:13:27 +02:00
Markus Mäkelä
f085abf720
Use one ssh connection for block/unblock operations
As the ssh_node_f function supports full shell syntax, all of the work can
be done with a single ssh connection. This removes the overhead that each
extra ssh connection adds.
2018-11-09 09:13:27 +02:00
Markus Mäkelä
4e3d1a29b6
Clean up Galera_nodes::check_galera
The code can be simplified as only one of the nodes needs to be checked to
see how many nodes are in the cluster.
2018-11-09 09:13:26 +02:00
Markus Mäkelä
69bf3a90d3
Fix and improve Galera startup
A certain templated parameter was only substituted when the VMs were
provisioned. This needs to be handled by the test framework to allow
changes into Galera clusters configuration.

Also made the startup of the "lesser" nodes parallel so minimize the
startup time.
2018-11-09 09:13:26 +02:00
Markus Mäkelä
2ac1656fc7
Fix galera initialization
The galera configurations need pre-processing before they can be
used. Switched to std::endl to automatically flush the output at the end
of each line. This makes it easier to see what is happening when the tests
are ran by buildbot. Also removed the extra startup of the servers that
was done right after installing the database.
2018-11-09 09:13:26 +02:00
Markus Mäkelä
ccec2a387a
Fix replication in parallel
If the replication is broken between the nodes, it is now fixed in
parallel on all nodes instead of doing it one server at a time.

This reduces the time from about 120 seconds to 13 seconds. The time was
measured by running the check_backend test first with all backends broken
and then with the fixed backends subtracting time of the latter from the
former.
2018-11-09 09:13:25 +02:00
Markus Mäkelä
71ffef5708
Partially revert 4ba011266843857bbd3201e5b925a47e88e1808f
Add back leading operator enforcement.
2018-09-20 15:57:30 +03:00
Markus Mäkelä
d11c78ad80
Format all sources with Uncrustify
Formatted all sources and manually tuned some files to make the code look
neater.
2018-09-10 13:22:49 +03:00
Niclas Antti
c447e5cf15 Uncrustify maxscale
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
2018-09-09 22:26:19 +03:00
Markus Mäkelä
a13e95951b
Merge branch '2.2' into develop 2018-08-30 11:37:49 +03:00
Timofey Turenko
4fd6d075cb doc and astyle fixes 2018-08-29 12:00:52 +03:00
Markus Mäkelä
b98c0841b4
Enable and fix -Wextra warnings
Fixed all warnings that were present with -Wextra.
2018-07-03 15:07:19 +03:00
Markus Mäkelä
9737962add
Add printf attribute to all variadic functions
The test methods that take printf style input now have the printf
attribute. This enables format checks making oversights less likely.

Also fixed any existing errors in the code. Only the one in
test_binlog_fnc.cpp would've had an actual effect.
2018-06-30 19:26:23 +03:00
Markus Mäkelä
5350817790
Flush hosts in parallel
The Mariadb_nodes class now performs the node flushing in parallel. This
should speed up startup. Also increased the max_connect_errors.
2018-06-20 08:45:18 +03:00
Johan Wikman
765806a633 Merge branch '2.2' into develop 2018-05-18 13:40:27 +03:00
Timofey Turenko
e911c897f6 fix cnf name in add_server_setting() 2018-05-18 12:32:23 +03:00
Markus Mäkelä
f4bdf3012d
Merge branch '2.2' into develop 2018-04-23 14:20:32 +03:00
Markus Mäkelä
0f0913fc99
Fix test build failures with GCC 8
GCC 8 enables -Werror=return-type by default which combined with -Werror
causes the build to fail.
2018-04-23 14:02:53 +03:00
Markus Mäkelä
f525822472
Merge branch '2.2' into develop 2018-03-20 13:14:54 +02:00
Markus Mäkelä
b0e0a79b46
Merge branch '2.1' into 2.2 2018-03-20 12:38:23 +02:00
Markus Mäkelä
02368473f7
Fix failover_mysqlmon
The test should stop MaxScale when it is fixing the replication to prevent
the triggering of the standalone master detection.

Also removed leading spaces from the messages and fixed a possible crash with a
NULL value given to `ssh_node`.
2018-03-20 10:59:08 +02:00
Timofey Turenko
022c226d4b
Mxs 1665 keepalived masterdown test (#171)
* add keepalived_masterdown test

* add missing cnfs
2018-03-16 15:14:14 +02:00
Markus Mäkelä
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
Markus Mäkelä
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
Johan Wikman
8bfb4f231a Merge branch '2.1' into 2.2 2018-03-06 10:38:01 +02:00
Markus Mäkelä
65216f5e16
Reset slave when changing master
When the test changes the master, it should reset the slave configuration
on the new master. This way no circular replication topologies are formed
and the monitor can be expected to perform correctly.
2018-03-05 14:02:41 +02:00
Markus Mäkelä
6a1aba70e7
Add test case for ignore_external_masters + failover
The test checks that failover works even when the master of the monitored
cluster is a slave to an external masters. The test also verifies that the
servers do not get unexpected status labels.
2018-02-07 16:07:16 +02:00
Markus Mäkelä
4420730f31
Start all tests with read_only disabled
Explicitly checking and setting read_only allows all tests to have a
consistent backend state.
2018-02-07 16:07:16 +02:00
Markus Mäkelä
0d037b2c24 Add configuration reset command
Resetting the settings makes it possible to start a test from a known good
configuration.
2018-02-02 12:28:07 +02:00
Timofey Turenko
8dfc1a141d fix typo in read_env() and set_env.sh 2018-01-15 17:17:44 +02:00
Timofey Turenko
847dd2c120 fix typo in read_env() and set_env.sh 2018-01-15 16:47:15 +02:00
Johan Wikman
3c5963cf3b Reset default master node state as well
Now that mariadbmon supports failover and switchover, a test may
may change the master to some other node than node 0.

Consequently, as part of fixing the replication, gtid_slave_pos
of node 0 must be reset as well.
2018-01-05 12:47:57 +02:00
Markus Mäkelä
3f0ef7481e Fix test build failure
The ssh_node_f function does not exist in 2.1.
2018-01-02 10:10:25 +02:00
Timofey Turenko
6645281aeb add killing mysqld process after snapshot revert 2018-01-02 07:32:44 +02:00
Timofey Turenko
ef79db4362 add killing mysqld process after snapshot revert 2017-12-29 12:12:20 +02:00
Markus Mäkelä
3ca32457db Don't force verbose output
The tests shouldn't force verbose output.
2017-12-27 17:21:42 +02:00
Timofey Turenko
5c7845c381 Galera startup crash fix, temporal removal of revert snapshot (Galera does not survive revert)
and add cores saving from tests themselves.
2017-12-21 17:20:41 +02:00
Markus Mäkelä
071ab8302b Remove old stashed configurations
When new configuration files are stashed, remove the old ones first.
2017-12-21 10:48:08 +02:00
Markus Mäkelä
c9aa504f50 Make start_node parameters const
The second parameter can be `const char*` as it is not modified. This
fixes a compiler warning.
2017-12-21 10:48:07 +02:00
Markus Mäkelä
2e68ba8c6e Automatically detect the need for GTID replication
Verifying that the requested replication type matches the one that is
currently in use allows the resetting of the nodes to automatically set up
the correct replication type. This means that a test that invokes
`Mariadb_nodes::require_gtid(true)` before initializing the
TestConnections class is given a replication setup that uses GTID
coordinates instead of file and position.
2017-12-19 16:44:46 +02:00
Markus Mäkelä
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
Markus Mäkelä
4451355e47 Don't force verbose output
The tests shouldn't force verbose output.
2017-12-19 15:00:39 +02:00
Timofey Turenko
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
Timofey Turenko
1a63e5ec7e
2.1 fix restore (#151)
* refactor test backend fixing

* return comatibility with 5.5 for backend restore

* remove backend configuration scripts
2017-12-18 23:47:02 +02:00