diff --git a/build.py b/build.py index 659afbbcc..659201890 100644 --- a/build.py +++ b/build.py @@ -57,6 +57,7 @@ def main(chapters=[], epub=False, pdf=False, html=False, mobi=False, pandoc_epub ] image_paths = [ + './cluster/cluster-images', './data-store/data-store-images', './sample/sample-images', './objmodel/objmodel-images', diff --git a/cluster/cluster-images/ballot.png b/cluster/cluster-images/ballot.png new file mode 100644 index 000000000..3b81d493a Binary files /dev/null and b/cluster/cluster-images/ballot.png differ diff --git a/cluster/cluster-images/ballot.svg b/cluster/cluster-images/ballot.svg new file mode 100644 index 000000000..080aa879a --- /dev/null +++ b/cluster/cluster-images/ballot.svg @@ -0,0 +1,9 @@ + + +2015-07-24 12:14ZCanvas 1Layer 1ProposerAcceptorAcceptorPrepare(N)Promise(N, val)Prepare(N)Promise(N, val)Accept(N, val)Accepted(N)Accept(N, val)Accepted(N)AcceptorPrepare(N)Promise(N, val)Accept(N, val)Accepted(N) diff --git a/cluster/cluster.markdown b/cluster/cluster.markdown index 7631c665b..d5a91aeb1 100644 --- a/cluster/cluster.markdown +++ b/cluster/cluster.markdown @@ -88,39 +88,10 @@ The protocol operates in a series of ballots, each led by a single member of the Each ballot has a unique ballot number based on an integer and the proposer's identity. The proposer's goal is to get a majority of cluster members, acting as acceptors, to accept its value, but only if another value has not already been decided. -A single ballot looks like this: -``` - -Proposer ------------------------- Acceptor Acceptor Acceptor - *--->>----/ Prepare(ballot_num=..) /--------+---------------+---------------+ - : ------------------------- : : : - : ----------------------------------- : : : - +---/ Promise(ballot_num=.., value=..) /-<<-* : : - : ----------------------------------- : : - : ----------------------------------- : : - +-----------/ Promise(ballot_num=.., value=..) /-----<<-----* : - : ----------------------------------- : - : ----------------------------------- : - +-------------------/ Promise(ballot_num=.., value=..) /---------<<---------* - : ----------------------------------- - : - : ----------------------------------- - *--->>--/ Accept(ballot_num=.., value=..) /-+---------------+---------------+ - : ----------------------------------- : : : - : -------------------------- : : : - +-------/ Accepted(ballot_num=..) /---<<----* : : - : -------------------------- : : - : -------------------------- : : - +---------------/ Accepted(ballot_num=..) /-------<<--------* : - : -------------------------- : - : -------------------------- : - +-----------------------/ Accepted(ballot_num=..) /-----------<<------------* - -------------------------- - -``` +\aosafigure{cluster-images/ballot.png}{A Ballot}{500l.cluster.ballot} -The ballot begins with the proposer sending a ``Prepare`` message with the ballot number *N* to the acceptors and waiting to hear from a majority. +A ballot begins with the proposer sending a ``Prepare`` message with the ballot number *N* to the acceptors and waiting to hear from a majority (\aosafigref{500l.cluster.ballot}.) The ``Prepare`` message is a request for the accepted value (if any) with the highest ballot number less than *N*. Acceptors respond with a ``Promise`` containing any value they have already accepted, and promising not to accept any ballot numbered less than *N* in the future. diff --git a/tex/cluster.tex b/tex/cluster.tex index f3220dc53..b69ac7124 100644 --- a/tex/cluster.tex +++ b/tex/cluster.tex @@ -132,40 +132,11 @@ acceptors, to accept its value, but only if another value has not already been decided. -A single ballot looks like this: +\aosafigure{cluster-images/ballot.png}{A Ballot}{500l.cluster.ballot} -\begin{verbatim} - -Proposer ------------------------- Acceptor Acceptor Acceptor - *--->>----/ Prepare(ballot_num=..) /--------+---------------+---------------+ - : ------------------------- : : : - : ----------------------------------- : : : - +---/ Promise(ballot_num=.., value=..) /-<<-* : : - : ----------------------------------- : : - : ----------------------------------- : : - +-----------/ Promise(ballot_num=.., value=..) /-----<<-----* : - : ----------------------------------- : - : ----------------------------------- : - +-------------------/ Promise(ballot_num=.., value=..) /---------<<---------* - : ----------------------------------- - : - : ----------------------------------- - *--->>--/ Accept(ballot_num=.., value=..) /-+---------------+---------------+ - : ----------------------------------- : : : - : -------------------------- : : : - +-------/ Accepted(ballot_num=..) /---<<----* : : - : -------------------------- : : - : -------------------------- : : - +---------------/ Accepted(ballot_num=..) /-------<<--------* : - : -------------------------- : - : -------------------------- : - +-----------------------/ Accepted(ballot_num=..) /-----------<<------------* - -------------------------- -\end{verbatim} - -The ballot begins with the proposer sending a \texttt{Prepare} message +A ballot begins with the proposer sending a \texttt{Prepare} message with the ballot number \emph{N} to the acceptors and waiting to hear -from a majority. +from a majority (\aosafigref{500l.cluster.ballot}.) The \texttt{Prepare} message is a request for the accepted value (if any) with the highest ballot number less than \emph{N}. Acceptors