News for hackers. Stuff that matters.
Re:Patroni: A Template for PostgreSQL HA with ZooKeeper, Etc... by CyberDem0n on Friday April 14, 2017 @06:09AM (#14113560)
> Stolon is quite comparable to Patroni and has more features than Patron.

Let me as a question, what feature Stolon has and Patroni doesn't? Can you give an example?

From my side I can provide list of features available in Patroni, but not in Stolon. For example:

* there is no way to do a controlled failover (switchover) in Stolon.

* in Patroni it's possible to exclude some nodes from a leader race.

* Patroni supports cascading replication

* Patroni can take basebackup from replicas if they are marked with a special tag

* it's even possible to configure Patroni to use a custom backup/recovery solution instead of pg_basebackup

* Patroni can give you a hint that postgres must be restarted to apply some configuration changes

* with Patroni it's even possible to schedule switchover or restart restart of postges on some specific time (for example 04:00 am, when traffic is minimal)

* with Patroni you can control High-Availability / Durability ratio. I.e.: what to do if master postgres has crashed? Either you will try to start it back or failover to a replica. But start of a crashed postgres may take a long time. With Patroni you can configure that if postgres didn't started in some amount of seconds - please do failover.

Stolon provides cloud-native deployment and Patroni doesn't? This is not really true. The main idea of Patroni is to be not dependent on some specific technologies. It can work as on bare-metal with the same success as on Kubernetes. It's very easy to build a custom solution with Patroni for your use-case. For example there is a Spilo project: https://github.com/zalando/spilo, a docker image build with Patroni and wal-e for a cloud deployments.

Re:Patroni: A Template for PostgreSQL HA with ZooKeeper, Etc... by vishesh92 on Friday April 14, 2017 @06:30AM (#14113627)
Thanks for this. As I mentioned in previous comment, I couldn't find much about Stolon. One of things I likee in stolon is the proxy, it enforce connections to the right PostgreSQL master and forcibly closes connections to unelected masters. Which is not present in Patroni, but I guess it should be doable using consul's service discovery and dynamic DNS. (I am not sure if this can be done using etcd and zookeper).
Re:Patroni: A Template for PostgreSQL HA with ZooKeeper, Etc... by CyberDem0n on Friday April 14, 2017 @06:42AM (#14113661)
Doesn't HAProxy provide such functionality? Patroni has REST API which can be used by HAProxy for a health-check.

patroni:8008/master will return http status code 200 only if the node running as elected master

patroni:8008/replica will return http status code 200 if node running as replica.

And final missing bit is a automation of generation of haproxy.cfg - it could be done with confd: https://github.com/kelseyhightower/confd

And here is an example of template file: https://github.com/zalando/patroni/blob/master/extras/confd/...

Re:Patroni: A Template for PostgreSQL HA with ZooKeeper, Etc... by vishesh92 on Friday April 14, 2017 @06:48AM (#14113674)
I am not sure, will HAProxy forcibly close connections to old master in case of a failover?
Re:Patroni: A Template for PostgreSQL HA with ZooKeeper, Etc... by CyberDem0n on Friday April 14, 2017 @06:55AM (#14113699)
on-marked-down shutdown-sessions

should do the trick