
The Two Generals' Problem (wikipedia) - paulgb
http://en.wikipedia.org/wiki/Two_Generals_Problem
======
donaldc
Assuming I was the general who decided when we'd attack, I'd send n messengers
each with a c chance of getting captured, yielding a (1 - c^n) chance of the
other general attacking at the same time. By adjusting for n, I could have
whatever probability of success I wanted, though never a guarantee of success.

One can calculate the chance of losing data stored redundantly on multiple
disks due to disk failure the same way, assuming that disk failures occur
independently of each other, as they might for a large internet company with
the data stored across multiple data centers.

------
JoeAltmaier
Assume a solution of N messages exists. The N'th message may fail. Either N
messages is not enough, or N-1 IS enough; then recurse on N-1.

------
ScotterC
Can someone explain to me why this is important. From the outset it's clear
that there will always be a chance of failure and the two generals can never
be certain. Why does it matter that this proof exists. Or is there something
that's non-obvious here.

~~~
lincolnq
It's an important impossibility result like the Halting Problem. You can be
led down the wrong path for hours designing protocols which attempt to solve
an unsolvable problem but do so in a seemingly-almost-correct way -- until the
complexity is so great that you can't understand where it goes wrong. If you
didn't have these results, you might be tempted to believe your solution at
that point was correct. With this result you can be sure it's wrong, recognize
the pattern of unsolvability, and give up much sooner.

~~~
ScotterC
That makes a lot of sense. But also just goes to show how effective
preliminary design work can be for making a smoother overall production curve.
Still, one can easily get lost in it if they don't step back every once in
awhile and realize their beating their heads against a wall.

~~~
paulgb
As a side-note, the way I came across the problem was that yesterday I was
trying to change the location of a date and my text messages were not always
getting through (possibly due to my proximity to the G20 cell jamming). I
realized that there was no way to know for sure, by text messages, whether we
both committed to the change. (fortunately it worked out anyway)

------
rubinelli
One thing I never understood is how you can guarantee consistency in
distributed transactions given this problem. Can you really build a 2-way ACID
system, or is only "eventual" consistency achievable?

~~~
tmorgan
There is also the Paxos algorithm:

<http://en.wikipedia.org/wiki/Paxos_algorithm>

(Bigtable uses 'Chubby' - google's implementation of Paxos)

------
jarek
Am I the only one annoyed by the recent (to me) trend of submitting Wikipedia
articles to Hacker News?

~~~
pkulak
I like it.

------
CapitalistCartr
In most real situations, people arrange more than one means of communication,
or more than one step, so there is not a single point of comm that is
critical. When I was in the Air Force, for one critical procedure there were
44 different methods of communication. Yeah, it was the Cold War, and we had
limitless money, but it was amazingly reliable.

------
tmorgan
Commius and Vercingetorix had this problem at Alesia; Caesar's troops enforced
a network partition!

------
doron
Fantastic link, and timely too. Thank you.

