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 theserverID
andserverport
of the standby before it became the new master. -
%%serverid%%
and%%serverport%%
refer to the currentserverid
andserverport
of the new master.
The equivalent for Helix Core Server Extensions are listed with the same names under Server extension session variables in 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.
-
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 failed-over trigger definition:
Field | Meaning |
---|---|
name |
The name of your trigger script, such as testTrigger2 |
|
Must be failed-back |
|
Must be failed-back |
|
The trigger for Helix Server to run when the master restarts after a successful failnback. Specify the command in a way that allows Helix 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 Server trigger variables. |
Example
In the Triggers: field, your form might have something similar to this:
testTrigger failed-back failed-back "perl '%serverroot%'/test.pl '%serverport%' '%serverid%' '%standbyserverid%' '%standbyserverport%'" testTrigger2 failed-back failed-back "perl '%serverroot%'/test.pl '%serverport%' '%serverid%' '%standbyserverid%' '%standbyserverport%'" testTrigger3 failed-back failed-back "perl '%serverroot%'/test.pl '%serverport%' '%serverid%' '%standbyserverid%' '%standbyserverport%'"