Middle+
What happens to a request during a leader restart in Patroni?
sobes.tech AI
Answer from AI
In Patroni, when the leader restarts, requests directed to this leader are temporarily not processed because the leader is unavailable.
At this moment:
- Patroni initiates the process of electing a new leader (failover) if the restart is prolonged.
- Clients connected to the old leader receive errors or timeouts.
- A mechanism of redirection or retry connection to the new leader is usually used.
- Patroni updates the information about the current leader in the consensus service (e.g., Etcd or Consul) so that clients can find the current leader.
Thus, requests are either blocked or redirected until access to the new leader is restored, ensuring high availability of the database.