Giter Site home page Giter Site logo

Comments (3)

jberkus avatar jberkus commented on August 28, 2024

So, I'm specifically working on this. It seems like there's two potential pathways forwards:

  1. write to the shared information service (SIS) with the information about the manual failover
  2. send signals to the API on each node about the failover

SIS Appoach:
Advantages:

  • client only needs to access the SIS
  • easy to integrate with SIS-based monitoring
  • consistency with other signals we may want to pass via the SIS, i.e. "nogovernor" flag
  • allows signalling other replicas not to try to grab the master flag
  • requires only a very simple client script

Disadvantages:

  • very asynchronous; hard to know when failover is complete except by polling
  • zero troubleshooting info if failover doesn't happen
  • requires admins writing to the SIS, which is a new pattern

Node API approach
Advantages:

  • synchronous: can find out how failover is going immediately
  • doesn't require touching the main failover loop
  • makes targeting specific nodes fairly obvious

Disadvangates:

  • requires securing the node API because now you can change databases via it.
  • client would need to be heavy; will have to connect to all database nodes, possibly, to make the failover go as planned
  • possible synchronization issues between data in SIS and what individual nodes are doing

Overall, it seems to me that doing this via the SIS makes more sense. Discussion?

from patroni.

jberkus avatar jberkus commented on August 28, 2024

The SIS approach seems like it needs only one extra piece of information: a "new-master" key for the cluster repo. The way it would work is:

  1. manual client writes the "new-master" key.
  2. the current master, at the beginning of its governor loop, checks for a new-master key. If the new-master key isn't itself, it shuts down the postgreSQL server and releases the master lock key.
  3. at the beginning of each replica's loop is a check for a new-master key. If present, this key preempts all other failover logic. If the key is present, that named server starts trying to acquire the master lock and become the master.
  4. Once the new replica has become the master, it removes the new-master key.

Issues/additions:

a. the old master needs to check the new-master's metadata in SIS to make sure that it's able to fail over before shutting down.

b. we need some way to indicate to the user why manual failover did not occur if it fails.

c. if the new-master is unable to promote after the old master is shut down, what should the system do? And how?

from patroni.

CyberDem0n avatar CyberDem0n commented on August 28, 2024

This feature is covered by: #56, #67 and #82

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.