« Back to Product

Documentation

IPS_DemoteToReplicationSlave

 bool IPS_DemoteToReplicationSlave ()

Returns

If the function succeeds, it returns TRUE, otherwise FALSE.

Description

Warning

This function is intended for internal use only and may change or be removed at any time without notice.

The function demotes a slave which has been promoted to master with IPS_PromoteToReplicationMaster or by an automatic failover back to slave. The instances which were activated on the promotion are put back into the status Standby and the synchronization with the master is resumed.

Warning

Changes made on the slave during the failover are overwritten by the configuration of the master on the next synchronization.

If the replication is not active, the function fails with "Replication is not active!". If the slave has not been promoted, the function fails with "Replication must have been promoted before a demote is allowed!". If the replication is not in the mode Standby, the function fails with "Replication must be in Standby-Mode!".

Example

// Demote back to slave after a failover as soon as the master is running again
if (IPS_IsReplicationFailoverActive()) {
    IPS_DemoteToReplicationSlave();
}
Any questions?