switchover.py: Add new options --replicating-master & --read-only-master

Authored by jcrespo on Jul 3 2019, 8:28 AM.

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.


switchover.py: Add new options --replicating-master & --read-only-master

--replicating-master allows a master switchover to happen on even
if the master is replicating originally, and it stops and resets
its replication; and after switchover happens, it sets it back on
the newly promoted master.

This option, disabled by default, allows a switchover to happen on
intermediate masters or circular replicating masters, automating
the disabing and reenabling of replication.

Note that it still requires the master to be a real master (read
only option must be disabled). If a master is an intermediate or
passive master, --read-only-master must be used, so the switchover
can happen, but read_only is kept as 1 on all servers during all

Aside from the new procedures, new verifications were added to
check that both options have expected initial and ending state.

Change-Id: Ica66fe925f2f53a67e3cbc7a0e760b395ad604b6