These problems practise reading an execution against the definitions of Module 1 and proving small facts about the models.
Problem 1
Problem 1.1 (Warm-up: true or false).Decide whether each statement is true or false, and justify it in one or two sentences using the definitions of Module 1.
- Under reliable broadcast, if a node delivers
and later crashes, every correct node eventually delivers . - Under FIFO broadcast, if A broadcasts
and, one second later in real time, B broadcasts , then every node delivers before . - Every execution that satisfies causal broadcast also satisfies FIFO broadcast.
- Under total order broadcast, at the end of an execution all nodes, faulty or not, have delivered the same set of messages.
- Under causal broadcast, two correct nodes may deliver the same two messages in different orders.
Solution
- False. That is uniform agreement. Plain agreement (Definition 1.6) only constrains deliveries by correct nodes; a node that delivers and then crashes may be the only one ever to deliver
. - False. FIFO order constrains only messages from the same sender. Real time plays no role in any of the definitions, and the two messages here come from different nodes, so a node may deliver
first. (Even causal order would allow it unless B had delivered before broadcasting .) - True. By part 3 of Theorem 1.13, a sender’s earlier message causally precedes its later one by program order, so causal order includes FIFO order.
- False. A faulty node may stop early: total order forbids it to skip or swap messages, not to deliver fewer of them. For correct nodes the statement is true: agreement makes their delivery sets equal.
- True, if the two messages are concurrent. In Figure 1.3, A delivers
before and B delivers before .
Problem 2
Problem 1.2 (Which models does this execution satisfy?).Three nodes A, B, C; no node crashes. Node A broadcasts
and later . Node B delivers and then broadcasts ; when B broadcasts it has not yet delivered , and when A broadcasts it has not yet delivered . Every node eventually delivers all three messages.
- List all pairs of messages related by causal precedence, and the concurrent pairs.
- For each of the following delivery sequences, say whether the execution satisfies FIFO, causal, total order and FIFO-total order broadcast, or explain why it cannot occur at all under the stated assumptions.
A delivers B delivers C delivers X1 X2 X3 X4 X5
Solution
1. Program order at A gives
. B delivered before broadcasting , so . Neither (B had not delivered , and no chain leads from to B before ) nor (A had not delivered ), so . 2. FIFO checks the pair
; causal checks and ; total order compares the three sequences.
FIFO causal total FIFO-total X1 yes yes yes yes X2 yes yes no no X3 cannot occur X4 yes no no no X5 no no no no
- X1: identical sequences that start with
; every constraint holds. It is even causal-total order. - X2: every node starts with
, so FIFO and causal hold; B swaps the concurrent pair relative to A, so total order fails. - X3 cannot occur: B delivered
before it broadcast , and it can deliver only after broadcasting it (integrity). So B’s sequence must have before . (This is the argument of Proposition 1.14; when the broadcaster delivers its own message, total order forces causal order.) - X4:
precedes everywhere (FIFO holds), but C delivers before although (causal fails), and C’s sequence differs from A’s (total order fails). - X5: C delivers
before , violating FIFO, hence causal; sequences differ, so total order fails too.
Problem 3
Problem 1.3 (Hold-back at a receiver).Four nodes A, B, C, D, no crashes. A broadcasts
. B delivers and then broadcasts . C broadcasts at the very start, before receiving anything, and reaches A and B only after they have broadcast and ; nobody broadcasts anything else. The messages reach node D in the order , , , and D’s broadcast layer delivers a message as soon as the model allows.
- Which pairs are causally related, and which are concurrent?
- Under FIFO broadcast, which messages does D deliver at each of the three arrivals?
- Under causal broadcast, which messages does D deliver at each of the three arrivals?
- List every delivery sequence that causal order allows at D.
- Suppose the broadcast is causal-total order and node A has already delivered
in that order. Which sequence must D deliver?
Solution
1.
, because B delivered before broadcasting . C broadcast before delivering anything, and A and B broadcast before reached them, so no chain of program-order and delivery-then-broadcast steps connects with the others: and . 2. FIFO only constrains messages from one sender, and all three senders differ. D delivers each message on arrival:
, then , then . The sequence is valid FIFO but violates causal order. 3. On arrival of
: D has not delivered , and , so is held. On arrival of : nothing precedes , deliver it. On arrival of : deliver ; now ‘s only predecessor is delivered, so deliver as well. Sequence: . 4. The orders that keep
before , with anywhere: , , . 5. Total order: A delivered
, so any node that delivers must deliver before it, and any node that delivers must deliver before it. D must deliver . (It is consistent with causal order, as part 4 shows; under total order alone D could not choose any other order either.)
Problem 4
Problem 1.4 (Total order makes nodes wait for their own messages).Call a broadcast algorithm self-immediate if, whenever a node broadcasts
, it delivers to its own application in the same step, before receiving any further message. Kleppmann notes that FIFO and causal broadcast can be implemented this way. Prove that no self-immediate algorithm satisfies total order broadcast in the asynchronous model, even if no node ever crashes and
.
Solution
Suppose, for contradiction, that a self-immediate algorithm satisfies total order broadcast in every execution. Consider an execution with two correct nodes A and B in which, at the very start, A broadcasts
and B broadcasts , each before receiving any message. The asynchronous model allows this schedule: nothing forces a message to arrive before the other node’s first step. Because the algorithm is self-immediate, A delivers
in the step in which it broadcasts it, before it can have received ; B delivers likewise before receiving . Both nodes are correct, so by validity A eventually delivers and B eventually delivers . By integrity each delivers each message once. Hence Apply the total order property of Definition 1.10 with
, : since and , we need , contradicting . So no self-immediate algorithm satisfies total order. Under FIFO and causal broadcast the same execution is fine:
and have different senders and are concurrent, so neither model constrains their relative order. This is why total order needs coordination (some node must wait for information from another) and the weaker models do not.
Problem 5
Problem 1.5 (Uniform agreement restores the causal arrow).Consider an execution that satisfies integrity, FIFO order, total order (Definition 1.10) and uniform agreement (Definition 1.6), and in which at least one node is correct. Prove that it satisfies causal order. Then explain which hypothesis Example 1.15 violates.
Solution
Let
be a correct node. As in the proof of Proposition 1.14, it suffices to prove the claim “every node that delivers has delivered before” for a single step of a causal chain; the induction over the chain length is then word for word the same. Program-order step. The same node broadcast
and then . FIFO order gives the claim. Delivery-then-broadcast step. Some node
delivered and later broadcast . Let be any node with ; we show .
- By uniform agreement, since
delivered , the correct node eventually delivers ; since delivered , eventually delivers . So . - Suppose
. Apply total order with and the node : since and , we get , so delivered before . But delivered before broadcasting , and by integrity , so delivered first. Contradiction. Hence . - Apply total order with
and the node : since and , we get . This proves the step, and by induction on the length of the chain, causal order.
In Example 1.15, node Q delivers
and the correct nodes R and S never do. That violates uniform agreement (it does not violate plain agreement, because Q is faulty). Step 1 of the proof is exactly where the argument needs it.