
Change the ordering of the two flushes such that FLUSH LOGS comes last. This seems to make sure gtid:s are updated to newest values before the MASTER_GTID_WAIT-call. Without this fix, switchover does complete succesfully, but some of the slaves may not be able to replicate due to not having same events as new master. Exact reason for this still unclear.