When the test finishes and is about to check whether MaxScale is alive,
the servers should be cleared from maintenance mode and the replication
should be fixed. This way the test will clean up after itself.
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.
When auto_failover has been disabled due to failure to perform automatic
failover, the test should reset the number of failures. Resetting it
before the check for the log message allows the test to still fail if the
message is missing.
Instead of the current master rejoining to the diverged master, the
current master should remain as the master server. This behavior should be
explained by the extra GTID event injected by the failover process.
The insertion and subsequent read of the data into the master in
`generate_traffic_and_check` will now be done inside a transaction. This
keeps the behavior consistent with the `check` function that only inserts
one row.
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.
The test uses a separate writer thread to insert data into the
master. This thread must be halted before the blocking of the master
happens as the slaves must catch up. Once slaves have caught up and the
master is blocked, the writer thread can continue doing inserts.
At the end of the test slaves must also be synchronized before the
inserted data is validated. This prevents test failures due to slave lag.
Tests that local_address is taken into account. However, at the time
of writing the maxscale VM does not have two usable IP addresses, so
we only test that explicitly specifying an IP-address does not break
things.
Locally it has been confirmed that this indeed works the way it is
supposed to.
The test repeatedly blocks and unblocks a master which goes unnoticed by
the monitor due to the 10 second read timeouts in the monitor
configuration in the longblob template. The replication template uses the
default timeouts which makes the test actually exercise the functionality
that it is intended to test.
The test now also creates TIME type values and checks that they are
converted correctly. Also added NULL value tests for all values and made
required adjustments to the code.