This parameter prevents Patroni from switching off the synchronous replication on the primary when no synchronous standby candidates are available. As a downside, the primary is not be available for writes (unless the Postgres transaction explicitly turns of synchronous_mode), blocking all client write requests until at least one synchronous replica comes up.
https://patroni.readthedocs.io/en/latest/replication_modes.h...
edit: seems I missed this discussion on twitter: https://twitter.com/jepsen_io/status/1265626035380346881
Can be reproduced even on a single node postgres. Just hammer it with inserts and maintain a local counter for inserts performed. Then, kill9 the postgres process. You'd expect your local counter to match the actual rows inserted, but you'll find that your counter will always be "less" than the actual rows inserted. Like any "networked" system, it is possible to lose commit acknowledgments even if the commit itself was successful.
So yes, you've not "lost" transactions per se. You've "gained" them, but it is still a data issue in either case.
People like to criticise NoSQL databases like MongoDB etc but at least they took on the challenge of making clustering easy enough to use and safe enough to rely on. Especially because it such a complex and error prone challenge.
Cassandra is one of if not the best since it's multi-master but it's a little bit more complex to setup.
MongoDB has definitely come a long way in terms of HA, but yes, they are still have a long way to go. A good primer talk on the differences can be found here: https://www.scylladb.com/tech-talk/mongodb-vs-scylla-product...
Does anyone here know how Amazon RDS's HA setup, particularly their multi-AZ option, works? That seems to be a switch that the AWS customer can just turn on. Do they have a proprietary implementation, even for non-Aurora Postgres?
And on top of this they have layered PostgreSQL, MySQL, MongoDB, Cassandra etc.
I doubt they will never release the code for it since it's very much a competitive advantage.
That seems inferior to having multiple sync replicas ready to take over without having to start a process and replay the WAL.
Also, such an HA block store seems very easy to replicate ( I'd guess there would be something open source already), not much of a competitive advantage.
- block-level replication can be more reliable in the long run operationally than some types of database replication, especially MySQL back in the day
- block-level replication has more scalable support staff available than hiring DBAs to fix database replication problems
- programming for all the edge cases is something that is a competitive advantage
- no licensing required for it
- you can probably guess which Open Source project it's based on
Source: DBA, worked there.
NB: It is Free software, don't be alarmed by the domain name.
- Single instance, if the instance dies they start a new one and mount the same storage. This can take some time, in general under 5min but I have seen it take 45min, especially for the large instance types.
- Multi A-Z, they run a hot standby with replicated and physically separated storage. Failover takes about a minute. The replication happens at storage level, every write has to be acknowledged by both availability zones. I'm not sure if Postgres is always running or if it gets started when failing over.
I guess you could replicate this using drbd.
They basically do replication at the storage layer. Each write has to be acknowledged by both the primary and secondary EBS volume.