Giter Club home page Giter Club logo

Comments (3)

Winslett avatar Winslett commented on September 17, 2024

Fencing: take a look at the setting and code around maximum_lag_on_failover. Each time the loop runs, we log the last XLOG position for the primary Postgres. With maximum_lag_on_failover, you can tailor the maximum bytes between the recorded value and a follower deemed healthy enough to failover.

Quorum: take a look at this method https://github.com/compose/governor/blob/master/helpers/etcd.py#L81. With it, we use the built in prevExist=false, it is a check and set action built into etcd. We rely on it to etcd's RAFT and prevExit to ensure there are no ties.

from governor.

asmartin avatar asmartin commented on September 17, 2024

Thanks for the fast reply!

Fencing: The maximum_lag_on_failover parameter makes sense in terms of preventing the failed node from becoming a candidate for failover, but what prevents a rogue node from coming back at some point and haproxy starting to send traffic to it? The stonith story is a good illustration of why the fencing mechanism needs to ensure that any rogue node is reset to a known clean state (e.g with a reboot via IPMI)

Quorum: okay, so it sounds like etcd's RAFT ensures that a race condition between multiple nodes cannot end in a tie or multiple concurrent masters?

from governor.

Winslett avatar Winslett commented on September 17, 2024

Great questions.

Haproxy status checks rely on etcd as a single source of truth. If a rogue node can take over the leader key, it would start receiving reads and writes. The maximum_lag_on_failover is one convention used to prevent that -- particularly when all nodes are shut down and nodes are started one at a time. Take a look at the blocker method is_healthiest_node (https://github.com/compose/governor/blob/master/helpers/postgresql.py#L125). The is_healthiest_node method is called before any node tries to take over as a leader.

If an etcd namespace is shared between Postgres Governor clusters, Governor doesn't prevent the cluster from comparing themselves to nodes of other clusters. It'd be awesome if you could code something up to prevent rogue clusters from trying to overthrow the current cluster's etcd namespace.

Take a look at the code and throw some scenarios at the code base. If you have a scenario of a rogue takeover that can be recreated, we'd love to solve for that situation.

from governor.

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.