Comments (2)
TL;DR: it solves the problem of an unknown leader.
When a stopped PostgreSQL with files in the data directory is started, it is started as a secondary without an accessible leader. I chose 169.0.0.1
because I was thinking it was the "Automatic Private IP Addressing" space , but I was wrong -- looks like I should have chosen 169.254.x.y.
I originally made this change for the scenario of an initialized deployment with no running Postgres members and the etcd TTL had expired. In that scenario, the best situation I could come up with was:
- governor starts PostgreSQL as a secondary
- governor queries all known PostgreSQL members to determine healthiest member
- governor only tries to take TTL if it is the healthiest member
Using this method, a deployment can recover from all hosts going down.
In this governor project, there is one check I did not implement between 2 and 3 above. It could be a "is reasonably healthy". With this, store the last known xlog position for the leader in a governor for each HA loop. Then, 2.5 would be "confirm this host is within some megabyte size of the last known leader xlog position." This additional check would prevent a stale PostgreSQL from taking over as leader if it is the only member running.
After I solved for the scenario above, I never had issues with PostgreSQL coming online as a secondary. When the HA loop would run, govern would point the secondary to the proper leader. Thus, it wasn't an issue.
from governor.
Thanks for the answer @Winslett ! About to port all this into Chef and it's definitely useful.
from governor.
Related Issues (20)
- database system identifier differs between the primary and standby? HOT 2
- etcd returns 500 internal server error on ubuntu which causes postgres to crash. HOT 1
- 404 error causing the postgres to go down
- Use python-etcd client library HOT 1
- Fatal: requested timeline 8 is not a child of this server's history HOT 3
- Fencing and Quorum Support HOT 3
- Local Docker cluster with Governor on board HOT 1
- Make governor a module
- PostgreSQL + haproxy with multiple IP HOT 3
- not catching ssl timeout exception HOT 1
- rewind ex-leader before joining again HOT 2
- [Errno 32] Broken pipe HOT 1
- non atomic has_lock() and update_lock()
- cannot easily "go build" golang-custom-raft; maybe we should have a new project? HOT 1
- golang-custom-raft: add abilty to execute post-election script HOT 14
- New GB build tool based off of golang-custom-raft branch with a new name - hapg HOT 2
- golang-custom-raft: If a PG process is unhealthy - it can kill governor
- golang-custom-raft: maximum_lag_on_failover doesn't work as it should
- help:the connect info in the recover.conf are "None"
- replication slots failing when names contain dashes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from governor.