Integrating an RCS¶
When an RCS changes shape — a new primary, a reconfigured standby — the applications and orchestrators connected to it need to know. Muppy calls your own Tasks at each step so you can tell them.
Declare these Tasks under Custom Actions, on the RCS's Configuration tab.
Three callbacks are available:
| Field | Called |
|---|---|
| Post 'Primary Change' Task | Right after the new primary is promoted. |
| Post 'Standby Change' Task | Right after each standby is reconfigured to follow the new primary. |
| Failover ex. Primary 'STONITH' Task | On failover, to fence the old primary. |
Each has a mock implementation in
muppy_postgresql_replication.scripts.postgresql_sr you can copy as a starting point:
mock_post_rcs_change_primary_task_id()mock_post_rcs_change_standby_task_id()mock_rcs_primary_stonith_task()
The Post 'Standby Change' Task fires once per standby, not once per RCS. Write it so it can run several times in a row.
