Comments (6)
The initialize flag means: The cluster has been successfully initialized. (Perhaps renaming the key could be useful). The design being that a cluster which has been succesfully initialized should not be automatically reinitialized.
What we are thinking of is the following:
- Win race to initialize
- Set initialize key with a small (minute?) ttl
- Initialize pgdata
- Verify correct initialization
- Update initialize key, remote the ttl
This will ensure that only 1 member will be initializing at any point in time, but if it does not succeed, other members can still initialize.
from patroni.
Well, the problem with "node has been successfully initialized" is that the key is set at the beginning of initialization. So what about just updating the contents of the key?
Currently the key has: "key":"/service/pgcluster1/initialize","value":"postgresql0"
What about making the value:
{ node: postgresql0, initialization: started, ts: 2015-08-31 19:53:22 }
... and when the initialization is complete, update it to:
{ node: postgresql0, initialization: complete, ts: 2015-08-31 19:54:02 }
The complete initialization should block, but the started initialization should be ignored if it's called again by a node of the same name. Makes sense?
from patroni.
Hmmmm ... the problem here seems to be more basic.
2015-10-22 18:22:46,989 INFO: removing initialize key after failed attempt to initialize the cluster
Yet:
(patronienv)josh@g:~/patroni$ curl -L http://172.17.0.5:2379/v2/keys/service/batman/initialize
{"action":"get","node":{"key":"/service/batman/initialize","value":"","modifiedIndex":13068,"createdIndex":13068}}
So patroni is actually calling to remove the key, but it's not getting removed. Will dig into why.
from patroni.
It looks like a bug, which was introduced with #69
from patroni.
This problem should be fixed in #77
from patroni.
This is confirmed as fixed. Closing issue.
from patroni.
Related Issues (20)
- Failed to get list of machines from V3<Unknown error: '404 page not found', HOT 1
- patronictl does not work HOT 1
- Patroni synchronous replication not working HOT 2
- DOC TIP on pg_ctl and wal_keep_segments HOT 1
- Need Help in Setting up docker-compose-citus.yaml HOT 2
- RAFT - failed to update leader lock HOT 1
- Acceptance tests fail on Debian unstable for Postgres < 12 HOT 5
- Failed to determine PostgreSQL state from the connection HOT 1
- Parameters such as max_connections, max_replication_slots, etc changed. No apparent way to find out how, by who, what or when change occurred. HOT 1
- Patroni changed leader for some reason HOT 12
- Do not check if Port is already in use with --validate-config HOT 1
- Migrate setup.py to pyproject.toml HOT 1
- max_connection value doesn't work unless you do with patronictl edit-config HOT 3
- List order of sync_standby is inconsistent with synchronous_standby_names
- Unexpected state for replicatefrom after switchover HOT 2
- patroni-consul RPM requires consul package HOT 2
- 3.2.2 throwing unexpected exception HOT 7
- Feature request: Include replication state in Consul service tags HOT 1
- Infinite recursion in handling of replicatefrom tags HOT 3
- patroni_failsafe_mode_is_active prometheus metric always 0 HOT 3
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 patroni.