Giter Site home page Giter Site logo

Comments (6)

feikesteenbergen avatar feikesteenbergen commented on August 28, 2024

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:

  1. Win race to initialize
  2. Set initialize key with a small (minute?) ttl
  3. Initialize pgdata
  4. Verify correct initialization
  5. 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.

jberkus avatar jberkus commented on August 28, 2024

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.

jberkus avatar jberkus commented on August 28, 2024

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.

CyberDem0n avatar CyberDem0n commented on August 28, 2024

It looks like a bug, which was introduced with #69

from patroni.

alexeyklyukin avatar alexeyklyukin commented on August 28, 2024

This problem should be fixed in #77

from patroni.

jberkus avatar jberkus commented on August 28, 2024

This is confirmed as fixed. Closing issue.

from patroni.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.