HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
TritonDataCenter
manatee
JavaScript2015–2018
TritonDataCenter / manatee

manatee

Automated fault monitoring and leader-election system for strongly-consistent, highly-available writes to PostgreSQL (TritonDataCenter, Manta).

4Distinct people
6Mentions
0Explicit recommenders
232GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Automated fault monitoring and leader-election system for strongly-consistent, highly-available writes to PostgreSQL (TritonDataCenter, Manta).

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year6 dated mentions

Observed mentions: 2015-06-08 03:48:48 UTC to 2018-10-22 09:39:30 UTC.

012342015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2018

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC404
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC202

What Hacker News says

6 sources
My guess at what happened: They had a split brain when multiple masters were running. Then they were not able to choose a master to keep because the data in both masters was 'corrupted' so they are now restoring from a backup. So how do they get data corruption from multiple masters running: 1) Performing reads from slaves during an update operation. If you perform a read from a slave then you might get data from the other master. If you update data on one master based on data from another master then you get data corruption. Probably they don't do this much because if you had any slave lag then you would notice this problem during normal operation. However, they might do it for checking permissions. You can imagine because this data almost never changes it would never show up as a problem normally. 2) Data stored outside of the database.
Read the rest
This would be the repositories themselves and cookie-session storage. Imagine repos have an incrementing id. Then if you have two masters a repo gets created with the same id on both masters. This is very bad because now two people can see each others data. You have the same problem with cookies. Imagine if you have user id as an incrementing id. The two masters create a user with the same id and an encrypted cookie or another storage system (redis) stores the user id. Now depending on which master you get routed to you appear as a different user. Weirdly enough this would always be a problem based on how their failover system works. The only safe way i know how to turn a master-slave system into a safe HA system is how joyent does it (https://github.com/joyent/manatee/blob/master/docs/user-guid... : you basically need a vote at commit time. if you have this then only 1 master can commit). However, I'm guessing most of the time they only have two masters running for < 1 minute but probably this time they had two masters running for a long time. EDIT: oh. they said it affected issues & pull requests [they have different dbs for different stuff] so repo and authentication stuff wouldn't apply. oh, they said no data was lost as well so presumably that would exclude a split brain running for a long period of time.
In Status.github.com: “We're failing over a data storage system”
i think the joyent-manatee HA [https://github.com/joyent/manatee] solution is the safest way of taking a system like PG that supports synchronous replication and giving it good availability properties while preserving durability. they basically have 3 nodes. - the master which must synchronously commit all writes to the slave - the slave which accepts synchronous writes from the master and may be promoted to the master - the asynchronous slave that accepts writes asynchronously from the slave [or from the master if you support rolling back the timeline] if the master dies, the the slave can promote itself to the master if it gains the support of the asynchronous slave. if the slave dies, then the master can no longer commit and it tries to promote the asynchronous slave to the new slave. if there is some confusion over who is dead the asy
Read the rest
nchronous slave basically adjudicates because it can only be promoted once to slave either by the master or the original slave. basically writes are only accepted if at least 2 nodes acknowledge the write and the system can survive one node dying. but because you need co-operation of 2 of 3 nodes in order to actually commit data in the system it doesn't have the split-brain issues you have with an external system checking for health and then telling nodes to stop connecting to the unhealthy master. i think the actual state machine used is a bit more complicated because they need to support removing/adding nodes and i think they end up requiring zookeeper in order to coordinate. flynn [https://flynn.io/docs/databases] also have a HA solution for postgres/mysql based on this. though, i can see why maybe this kind of setup might not perform as well as one where you are accepting writes after committing 2 out of N to the read replicas. especially when you already need lots of read replicas.
In MySQL High Availability at GitHub
Sure, but the underlying primitives are better. Specifically it supports quite flexible binary replication including the new logical replication features. With this you can build things like Manatee[1] which enable effectively seamless HA. The platform I am currently working on Flynn[2] uses a variant of this state machine to implement an effectively maintenance free Postgres cluster. In future though there will be support for bi-directional replication in Postgres, i.e true multi-master support. [1] https://github.com/joyent/manatee [2] https://flynn.io/
In What MongoDB got right
Thanks for writing this up! At Joyent, we built a similar system for automated postgresql failover called Manatee. I'm sure today we would have used a Raft-based system, but that was not available when we did this work, so we used ZooKeeper. We haven't spent much time polishing Manatee for general consumption, but there's a write-up on how it maintains consistency[1]. The actual component is available here[2], and it's also been ported to Go as part of Flynn[3]. Edit: Manatee uses synchronous replication, not async, so it does not lose data on failover. [1] https://github.com/joyent/manatee-state-machine [2] https://github.com/joyent/manatee [3] https://github.com/flynn/flynn
In High Availability for PostgreSQL, Batteries Not Included
It sounds like if you smash together Project Goverenor and Flocker you get Joyent's Manatee[1]. It uses ZooKeeper to automatically manage a PostgreSQL cluster. It also uses a separate ZFS dataset to hold the database, so backup and restore can be accomplished just using "zfs send" and "zfs recv". It's open source[2] Javascript if you want to check it out. [1]: https://docs.joyent.com/sdc7/troubleshooting-sdc7/manatee [2]: https://github.com/joyent/manatee
In Containers and persistent data

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.