Skip to content

Instantly share code, notes, and snippets.

@jki127
Last active November 15, 2018 17:09
Show Gist options
  • Select an option

  • Save jki127/21a41ddb2f20f1b784a7e3acbbffd6c2 to your computer and use it in GitHub Desktop.

Select an option

Save jki127/21a41ddb2f20f1b784a7e3acbbffd6c2 to your computer and use it in GitHub Desktop.

Consensus - DistSys Lecture - Nov 13th, 2018

Safeness requirements

  • Only a single value can be chosen
  • Only a value that has been proposed can be chosen
  • A process can learn that a value is chosen only after it’s chosen

Liveness requirements

  • Some proposed value is eventually chosen
  • If a value is chosen, a process eventually learns it

Consensus & Broadcasting

  • If you have a consenus algorithm, it’s pretty easy to apply it in order to create a reliable totally-ordered broadcasting algorithm
  • Vice-versa, if you have a total-ordered algorithm then it’s easy to apply to a consensus algorithm
  • The IS-IS algorithm has consensus

PAXOS Algorithm

Roles

  1. Proposer
  2. Acceptor
  3. Learner

Unique Proposer ID

unique ID = local serial counter + “.” + node ID

Steps

  1. Proposer sends a “propose” message to all Acceptors containing its proposed value and a unique proposal number.
  2. In response, each proposer replies to the proposer with an already accepted value and proposal number. If it doesn’t have a accepted value it sends back a special value “No accepted value”. The proposers should then receive a majority accepted value. If it doesn’t, it should resend the proposals.
  3. ( TOO MUCH TO WRITE. get it from epstein’s lecture notes )

Proposer sends message to acceptors Proposer sends accept message to acceptors -> Acceptors “promise” not to accept any proposals lower than the accepted value

Invariants

  • P1. An acceptor must accept the first proposal it receives
  • P2. If a proposal with value V is chosen, then every higher-numbered proposal that is chosen has value V
  • P2A. If a proposal with value V is chosen, then every higher-numbered proposal accepted by any acceptor has value V
  • P2B. If a proposal with value V is chosen, then every higher-numbered proposal issued by any proposer has value V.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment