Live data from Hacker News

Consensus Is Harder Than It Looks (2020)

brooker.co.za

11–20 of 32 posts

Re: Consensus Is Harder Than It Looks (2020)

#11
post #5

I am implementing a Multi-Paxos variant called Viewstamped Replication ( http://pmg.csail.mit.edu/papers/vr-revisited.pdf ) for TigerBeetle ( https://github.com/coilhq/tigerbeetle ) and keeping notes along the way to help other implementors down the line. Some things I'm finding so far: * As developers, we're used to thinking of services in terms of streaming TCP connections and RPCs. You send a request on a connecti…

> I am implementing a Multi-Paxos variant called Viewstamped Replication

VR is -not- a variation of Paxos much less the later multi-paxos.

Viewstamped Replication was developed independently from Paxos and is distinct from Paxos. (And it came out a year before Paxos):

From the author of this OP:

https://brooker.co.za/blog/2014/05/19/vr.html

"Introduced in May 1988 in Brian Oki's PhD thesis, Viewstamped Replication predates the first publication of Paxos by about a year. If you're looking for intrigue you may be disappointed: both Lamport and Liskov claim the inventions were independent."

Re: Consensus Is Harder Than It Looks (2020)

#12
The author mentions in passing "Virtual Synchrony" . It turns out it is used in some highly critical systems via ISIS/VSync framework from Cornel:

The "CORBA Fault Tolerant Objects standard" is based on the virtual synchrony model. Virtual synchrony was also used in developing the New York Stock Exchange fault-tolerance architecture, the French Air Traffic Control System, the US Navy AEGIS system, IBM's Business Process replication architecture for WebSphere and Microsoft's Windows Clustering architecture for Windows Longhorn enterprise servers.

https://en.wikipedia.org/wiki/Virtual_synchrony#Virtual_sync...

https://en.wikipedia.org/wiki/Vsync_(computing)

Re: Consensus Is Harder Than It Looks (2020)

#13
post #5

I am implementing a Multi-Paxos variant called Viewstamped Replication ( http://pmg.csail.mit.edu/papers/vr-revisited.pdf ) for TigerBeetle ( https://github.com/coilhq/tigerbeetle ) and keeping notes along the way to help other implementors down the line. Some things I'm finding so far: * As developers, we're used to thinking of services in terms of streaming TCP connections and RPCs. You send a request on a connecti…

> I am implementing a Multi-Paxos variant called Viewstamped Replication VR is -not- a variation of Paxos much less the later multi-paxos. Viewstamped Replication was developed independently from Paxos and is distinct from Paxos. (And it came out a year before Paxos): From the author of this OP: https://brooker.co.za/blog/2014/05/19/vr.html "Introduced in May 1988 in Brian Oki's PhD thesis, Viewstamped Replication pr…

VR was of course developed independently by Barbara Liskov and Brian Oki and then revisited by Barbara Liskov with James Cowling.

However, it is common practice and perfectly acceptable to refer to VR as a variant of "Multi-Paxos" because that's actually EXACTLY what it is in theory, the protocol maps one-to-one, cf. Dan Ports (he explains it nicely here, see slide 46 if you want his bumper sticker version): https://courses.cs.washington.edu/courses/csep552/16wi/slide...

The more you understand VR and Multi-Paxos the more you will see that this is true.

In fact, and you may be surprised/disappointed at this, but Raft is also a variant of Multi-Paxos very similar to VR (cf. Heidi Howard https://groups.google.com/g/raft-dev/c/cBNLTZT2q8o), except with tighter restrictions on leader election that make it less efficient than VR, which is why we chose VR over Raft coincidentally.

By the way, that's a fantastic post by Marc Brooker and was part (along with references by Martin Thompson and Heidi Howard) of what made us pay more attention to VR in the first place.

Re: Consensus Is Harder Than It Looks (2020)

#15
post #13

Earlier quoted context omitted.

> I am implementing a Multi-Paxos variant called Viewstamped Replication VR is -not- a variation of Paxos much less the later multi-paxos. Viewstamped Replication was developed independently from Paxos and is distinct from Paxos. (And it came out a year before Paxos): From the author of this OP: https://brooker.co.za/blog/2014/05/19/vr.html "Introduced in May 1988 in Brian Oki's PhD thesis, Viewstamped Replication pr…

VR was of course developed independently by Barbara Liskov and Brian Oki and then revisited by Barbara Liskov with James Cowling. However, it is common practice and perfectly acceptable to refer to VR as a variant of "Multi-Paxos" because that's actually EXACTLY what it is in theory, the protocol maps one-to-one, cf. Dan Ports (he explains it nicely here, see slide 46 if you want his bumper sticker version): https://…

Not surprised or disappointed, really. My take on RAFT is that it's basically Paxos for elections and a more relaxed regime in between.

But Brooker's post (in my OP) actually addresses VR vs Paxos distiction:

It's easy to believe that these two protocols are, in fact, the same. That doesn't appear to be the case. A new paper by van Renesse et. al., titled Vive La Difference: Paxos vs. Viewstamped Replication vs. Zab, looks at Paxos and VR through the lenses of refinement and abstraction, and finds they are not exactly equivalent due to design decisions in the way they refine a model the paper calls Multi-Consensus. One of the key differences is active (Paxos) vs. passive (VR) replication: "Passive vs. Active Replication: In active replication, at least f + 1 replicas each must execute operations. In passive replication, only the sequencer executes operations, but it has to propagate state updates to the backups."

Which reminds of ZAB (of Zookeepr fame), another protocol languishing in relative obscurity.

Anyway, thanks for your input. I have this thing for underdogs and this VR vs Paxos thing is a very minor cause, and I guess you triggered me there. /g

Re: Consensus Is Harder Than It Looks (2020)

#16

Ohh for sure! I tried implementing Raft, which is supposed to be the most understandable out of all available consensus algorithms, but wasn't able to make it work 100%. I came close but in the end gave up on resolving some concurrency issues :/

How did you know there were still concurrency issues? I would expect issues like that to be relatively subtle. Did you build out a test suite?

Heh... knowing for certain that you've gotten all the concurrency issues is hard. Knowing that a specific code base has concurrency issues can be very easy, by virtue of them clearly exhibiting bugs. I haven't tried to implement RAFT myself but I've certainly had code bases that clearly had concurrency bugs in them, even if I didn't know exactly what they were. :)

Re: Consensus Is Harder Than It Looks (2020)

#17
Cache invalidation, one of the so-called hardest things in software, is simply a consensus problem on the lifetime of data. Naming things is consensus on definitions.

Consensus isn’t just hard, it’s the hardest thing. Possibly even the only hard thing, if you include the social aspects of software development too (which involve human consensus).

Re: Consensus Is Harder Than It Looks (2020)

#18

If we can't make machines reach a consensus, what hope is there for human beings?

Nine out of ten scientists ardently believe reaching consensus is harder than it looks. The remainder are unpersuaded and firmly believe that reaching consensus is easy.

Re: Consensus Is Harder Than It Looks (2020)

#19
post #13

Earlier quoted context omitted.

VR was of course developed independently by Barbara Liskov and Brian Oki and then revisited by Barbara Liskov with James Cowling. However, it is common practice and perfectly acceptable to refer to VR as a variant of "Multi-Paxos" because that's actually EXACTLY what it is in theory, the protocol maps one-to-one, cf. Dan Ports (he explains it nicely here, see slide 46 if you want his bumper sticker version): https://…

Not surprised or disappointed, really. My take on RAFT is that it's basically Paxos for elections and a more relaxed regime in between. But Brooker's post (in my OP) actually addresses VR vs Paxos distiction: It's easy to believe that these two protocols are, in fact, the same. That doesn't appear to be the case. A new paper by van Renesse et. al., titled Vive La Difference: Paxos vs. Viewstamped Replication vs. Zab,…

"My take on RAFT is that it's basically Paxos"

You're right that Raft is Paxos for the leader election phase, in the same way that VR is Paxos for the view change phase, or that Paxos is basically VR's view change but for deciding a value.

But a better way of saying this would be that Raft is Multi-Paxos (https://news.ycombinator.com/item?id=23123701), because Raft is much more than Paxos (in the same way that VR is more than Paxos because it not only decides on a value/leader but is also a protocol for replication). I think this is where our misunderstanding came in.

Yes, I've read the linked "Vive La Difference" paper. As the excerpt makes clear, one of the key differences is active replication (Paxos: with multiple concurrent processes that want to decide on a value) vs passive replication (Multi-Paxos variants: VR and Raft and ZAB all protocols with a single leader elected for a given term/view during which multiple rounds of replication take place).

The name Multi-Paxos just means that the first round of Paxos for leader election is reused for multiple rounds of replication, driven by a single leader instead of competing processes always using the minimum two-phase Paxos.

"I have this thing for underdogs"

Yes, me too, and that's why I tried to show that VR is no less than Multi-Paxos in my original comment, and that Raft is not newer than Multi-Paxos in my follow-up. It would be great for VR to receive the recognition it deserves.

Re: Consensus Is Harder Than It Looks (2020)

#20
Author spends some time on determinism, which got me thinking of CRDTs, which are trying to make state changes commutative. They are in effect trying to get from linearalized state changes to causality. If we find a way to solve that problem, we have a more efficient consensus than Raft, one that can withstand small gaps in availability.

I keep waiting for someone to bring a Turing, Gödel, or Shannon into this and point out it’s not computable.

That worry aside, this thought process also brought me to monoids, which are used to share state in some functional languages. I’m curious how much information about concurrent state change is locked up in that space that people trying to solve the general problem don’t have ready access to.

Post reply on HN