Failback after failover

After a successful failover, the former standby server has taken over as the new master or commit server. You might now want to "failback", that is, to restore the original master or commit server to its former role. Failback is common when the failover was done for testing purposes. Failback is also a valid choice after failover for disaster recovery or maintenance.

Prerequisites

  1. Perform the steps at Prerequisites for a successful failover.
  2. Before starting the former master or commit server, which will now become a standby server, reconfigure the former master or commit server so that its ServerID is different from the ServerID of the current master.

Reseeding the original master

Generally, it is a best practice to reseed the original master from the new master before performing the failback steps. Consider the following:

If the original master did not participate in the failover ... If the original master participated in the failover ...
... the old master's metadata might contain transactions that did not make it to the original standby at the time of failover. Those transactions could reappear at failback. To avoid this possibility, reseed the original master from the new master before performing the failback steps. ... reseeding might not be necessary. However, if you have any doubts about metadata integrity, the safest option is to reseed the original master from the new master before performing the failback steps.

Failback steps

At the new commit server

  1. At the new commit server, verify that the standby is pulling from new commit server by issuing p4 servers -J
  2. Check the result, which might be something like:

    commit '2019/07/09 16:41:36' commit-server 40/13642 40/13642 wadL/1 1

    standby '2019/07/09 16:41:31' standby 40/10000 40/10000 wAdl/4 1

    where 10000 is lower than 13642, which indicates that the standby is not yet fully caught up with the commit server.

  3. Wait a moment, then reissue p4 servers -J to verify that standby is fully caught up with the commit server. For example:

    commit '2019/07/09 16:41:36' commit-server 40/13642 40/13642 wadL/1 1

    standby '2019/07/09 16:41:36' standby 40/13642 40/13642 wAdl/4 1

At the new standby that was the original commit

  1. Issue the failover command: p4 failover -y
  2. Follow the steps at Failover.