Patroni tries to be non-invasive and do not try to start the database that is already running in the master/replica role if that role matches the one patroni designates for it (according to the locks in etcd or zookeeper). On the other hand, the on_start callback may change the connection pooler/load balancer configuration or assign the floating ip, and we still want Patroni to try doing this for the already running server (it may fail, but that's not a big deal).
Therefore, we should call the on_start callback even in the case when Patroni starts without starting the database.
@alexeyklyukin @CyberDem0n @feikesteenbergen Should we tag this as "enhancement" and/or "help wanted"?
yes to both.
https://github.com/zalando/patroni/pull/262 should solve this issue