Triggering on failed-back

This can be fired only during p4 failback when the newly restored master first starts up during a successful p4 failback command. This trigger could be used to perform a DNS change, or any other activities needed to support replication after failback.

The special variables:

  • %%standbyserverid%% and %%standbyserverport%% expand to the serverID and serverport of the standby before it became the new master.

  • %%serverid%% and %%serverport%% refer to the current serverid and serverport of the new master.

Note

The equivalent for Helix Core Server Extensions are listed with the same names under Server extension session variables in the Helix Core Extensions Developer Guide.

To define a failed-back trigger, use the p4 triggers command to configure the triggers form with this syntax:

triggerName failed-back failed-back command

Note that most of the usual trigger variables are not available for this trigger because this fires at server startup before any client connection.

Also note that multiple failed-back triggers run in the background asynchronously, and that a failed failed-back trigger does not prevent any other failed-back triggers from running.

Note
  • most of the usual trigger variables are not available for this trigger because this fires at server startup before any client connection

  • multiple failed-back triggers can run in the background asynchronously

  • a failed failed-back trigger does not prevent any other failed-back triggers from running

  • See also Triggering on failed-over and Triggering on heartbeat (server responsiveness).

The following table describes the fields for a trigger definition:

Field Meaning
name

The name of the trigger, such as testFailedBack2

type

Must be failed-back

path

Must be failed-back

command

The trigger for Helix Core Server to run when the master restarts after a successful failnback. Specify the command in a way that allows Helix Core Server to locate and run the command. The command is typically a call to a script. The command must be quoted. The command can take any arguments that your trigger can parse, including Helix Core Server trigger variables.

Example

In the Triggers: field, your form might have something similar to this:

testFailedBack failed-back failed-back "perl '%serverroot%'/test.pl '%serverport%' '%serverid%' '%standbyserverid%' '%standbyserverport%'"
testFailedBack2 failed-back failed-back "perl '%serverroot%'/test.pl '%serverport%' '%serverid%' '%standbyserverid%' '%standbyserverport%'"
testFailedBack3 failed-back failed-back "perl '%serverroot%'/test.pl '%serverport%' '%serverid%' '%standbyserverid%' '%standbyserverport%'"