Unit 8 of 12 · about 5 hours · derive, implement, measure

Gossip dissemination, a gossip membership implementation and convergence measurement

Gossip trades immediate agreement for eventual convergence at constant per-node cost. It carries membership, and later repair, without any coordinator.

You'll be able to

  • Derive per-round growth and rounds-to-cover for a fanout and size, and state the no-duplicate-contact assumption.
  • Implement push gossip over a peer list that converges with partitions and heals after them.
  • Measure messages per operation and convergence time from a Maelstrom run and compare against the rumor model.

Covers

Gossip dissemination and epidemic convergenceGossip membership implementationGossip traffic and convergence measurement
1

Read

In this order, only the parts listed

0 of 2 done

  1. Infection-style disseminationSWIM: Scalable Weakly-consistent Infection-style Process Group Membership (Das et al., 2002)

    Section 4.1: piggybacking on ping, ping-req and ack with no extra packets, the bounded buffer, and preferring updates gossiped fewer times

  2. Broadcast challenges 3a to 3cGossip Glomers - Unique IDs and Broadcast

    Challenge 3a (single node), 3b (five nodes, no partitions) and 3c (five nodes with the partition nemesis); the checker tests convergence of every value to every node, not order or recency

    Stop at 3c. The 3d and 3e efficiency thresholds belong to their own 25-node setup and are not targets here.

2

Focus on

  • Each round multiplies the informed set: for fanout , assuming every contact reaches a new node. Real contacts repeat, so the model is an upper bound on speed.
  • SWIM sends no dedicated gossip packets: membership updates ride the failure-detector traffic. Under overload the buffer keeps younger updates, so fresh changes infect a few members first and the rest once the rate quiets.
  • Partitions only delay: challenge 3c passes when every value reaches every node by the end of the run, because re-contact after healing carries the backlog.
  • Convergence is the whole contract. Gossip promises nothing about recency, order or durability, so a converged read can still be stale.
Common mistakes · 3
  • Quoting the doubling curve as measured behavior. Duplicate contacts and slow nodes stretch every round, so treat the model as the ceiling and your run as the floor.
  • Reading convergence as consistency. Two nodes can converge on different values at different times with no violation; ordering needs the clocks from earlier units.
  • Gossiping full state every round. The 3b page calls that impractical; send deltas or digests, and keep per-round bytes bounded as the cluster grows.
3

Try it yourself

Closed-book, before checking anything

Closed-book, run the rumor model: with and fanout 1 the rounds give 2, 4, 8 and 16, and full cover needs 7 rounds since . With and fanout 2 the third round computes 27 and caps at 10.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.Fanout 2, ten nodes, one informed. How many rounds to cover all, and what caps the math?Answer

    Three: 3, 9, then 27 capped at 10. The cap is the cluster size; extra contacts after cover are duplicates.

  2. 2.Why does SWIM prefer younger buffer entries when piggyback space runs out?Answer

    Fresh changes must infect someone quickly or they stall everywhere. Once the injection rate quiets, the backlog still propagates through later rounds.

  3. 3.A 3c run converges but one read missed a late write. Bug or expected?Answer

    Expected. The checker tests convergence by end of run, not recency, so a read may miss a write that had not arrived yet.

  4. 4.Your 5-node run converges in 2 seconds. Does gossip guarantee 2-second convergence at 50 nodes?Answer

    No. Rounds grow slowly but per-round work, duplicates and the partition schedule all change; remeasure on the new setup.

5

Practice

  • Gossip Glomers 3a to 3c: Broadcast

    Run 3a with one node, 3b with five nodes, and 3c with five nodes plus the partition nemesis, at rate 10 for 20 seconds, as ./maelstrom test -w broadcast --bin ~/go/bin/maelstrom-broadcast --node-count 5 --time-limit 20 --rate 10 --nemesis partition adjusted per challenge; keep every run directory

    The command quotes the page's Go binary path; point it at your own binary. Read messages-per-operation and stable latencies from your own 3c results file as a labeled example, and compare convergence rounds with the rumor model.

  • Simulate Gossip Rumor Spread

    Implement spread with informed = min(n, informed * (1 + fanout)) per round, capping late rounds at n; the examples cover doubling and the 27-to-10 cap

    Do this before the cluster runs. It fixes the ceiling your measured spread must sit under.

You're done when

The rumor examples pass from memory, 3c passes with its run directory kept, and you can explain your measured rounds as model ceiling plus duplicates.

Only when you can do this without notes.

Leads to

Notes

Resources · 2 for this unit, 12 more in the section
  • SWIM: Scalable Weakly-consistent Infection-style Process Group Membership (Das et al., 2002)Cornell University · support

    Read the direct and indirect probing detector, infection-style dissemination, the suspicion mechanism and incarnation numbers. Suspicion timeouts depend on the workload.

  • Gossip Glomers - Unique IDs and BroadcastFly.io and Jepsen · required

    Each challenge runs locally under Maelstrom (v0.2.4; the pages were tested on 0.2.3) with its checker and, where the page says so, the partition nemesis; keep the run directory as the history. Do challenge 2 (unique IDs under partition with total availability) and 3a to 3c (broadcast, then with partitions). A pass shows uniqueness or convergence in that run, not ordering or recency.

Also in this section