box.ctl.demote()
-
demote
()¶ Since version 2.10.0.
Revoke the leader role from the instance.
On synchronous transaction queue owner, the function works in the following way:
- If box.cfg.election_mode is
off
, the function writes aDEMOTE
request to WAL. TheDEMOTE
request clears the ownership of the synchronous transaction queue, while thePROMOTE
request assigns it to a new instance. - If box.cfg.election_mode is enabled in any mode, then the function makes the instance start a new term and give up the leader role.
On instances that are not queue owners, the function does nothing and returns immediately.
Parameters: none
Return: nil - If box.cfg.election_mode is