def on_demote(self) -> None:
        """On demote handler.

        Is called when the primary was demoted.
        """
On demote handler.

        Is called when the primary was demoted.
        
patroni/postgresql/mpp/__init__.py