mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
It wasn't a big issue when on_start was called during normal boostrap with initdb, because usually such process is very fast. But situation is changing when we run custom bootstrap, becuase it might be a long time between cluster become connectable and end of recovery and promote. Actually situation was even worse than that, on_start was called with the `replica` argument and later on_role_changes was never called, because promote wasn't performed by Patroni. As a solution for this problem we will block any callbacks during bootstrap and explicitly call on_start after leader lock was taken.