skip to content

Why is the membership that holds a cluster's metadata role kept small and odd-sized rather than spanning every node?

level: middleimportance: must knowfreq 58%

answer

  1. a majority must agree
  2. count sets cost and tolerance
  3. the even member is pure cost
  4. three tolerates one, five tolerates two
  5. not the write acknowledgement number

basics

~20 s

Every change to cluster state must be agreed by a majority of that membership, so each extra member raises the number that must agree and the work per change without adding proportional failure tolerance. Odd sizes avoid paying for a member that tolerates nothing extra.

solid answer

~50 s

The metadata role only admits a change when a **majority of its membership** agrees to it, so the size of that membership sets both the cost of every change and how many losses it survives. Three members need two to agree and survive one loss; five need three and survive two; seven need four and survive three. Adding a fourth member to a three-member set raises the majority to three while still surviving only one loss — you pay more per change for nothing. That is why these memberships are kept odd. Keeping them small matters for the same reason: agreement costs round trips, and it is paid on every structural change. Note that this majority is about **cluster state**, not about how many copies of a record must acknowledge a write — those are different numbers chosen for different reasons, and confusing them is the classic error here.

go deeper

for a junior

Remember that a small set of members has to agree before the cluster's shape can change, and that this set stays small even in a big cluster.

for a middle

Do the arithmetic aloud: three needs two and survives one, four needs three and still survives one, five needs three and survives two — so the even member costs without buying.

for a senior

Show the operational consequence: with three members, one down means the next loss freezes every structural change, which is exactly why maintenance on a coordination member is planned, not casual.

for a principal

Set the estate default and defend it — the membership size, whether it sits on shared or dedicated machines, and the rule that it does not grow as clusters grow.

## What the number is actually buying The metadata role is the single authority for cluster state, and it stays a single authority by requiring that **a majority of its membership agrees before any change is admitted**. Requiring a majority is what stops two halves of a split cluster both believing they are in charge: two disjoint sets cannot both contain more than half of the same membership. The size you choose for that membership therefore decides two things at once — how many of its members can be lost while change is still possible, and how much agreement every single change has to buy. ## The arithmetic, in full | membership size | majority needed | losses tolerated | |---|---|---| | 3 | 2 | 1 | | 4 | 3 | 1 | | 5 | 3 | 2 | | 6 | 4 | 2 | | 7 | 4 | 3 | Read the table down the even rows and the argument for odd sizes writes itself: - going from three to four raises the majority from two to three, and still tolerates only one loss; - going from five to six raises the majority from three to four, and still tolerates only two; - the even member is pure cost: one more machine to run, patch and monitor, one more participant in every agreement, and not one extra failure survived. ## Why small, and not just odd Small is a separate argument from odd, and it has three legs: 1. **Agreement is paid per change.** Every structural change — a stream created, a partition moved, an ownership change recorded — needs a majority to accept it. More members means more messages and more waiting on the slowest of the members needed to form that majority. 2. **Tolerance grows slowly and cost grows steadily.** Going from three to five buys exactly one more tolerated loss. Going from five to eleven buys three more, for more than twice the agreement cost, which is almost never a trade anyone wants. 3. **The membership is not where scale comes from.** Serving more traffic means more record-serving nodes. The coordination membership does not get bigger because the cluster does; a cluster of a hundred record-serving nodes is commonly coordinated by three or five members. This surprises people who assume every node must vote. There is one real reason to prefer five over three, and it is worth saying out loud: with three, a single member down leaves you one failure from being unable to change anything, which makes routine maintenance on a coordination member a tense operation. Five gives you room to take one out deliberately and still tolerate one unplanned loss. ## The confusion to avoid The majority discussed here is about **cluster state**, and it is a different number from **how many copies of a record must acknowledge a write before the write counts**. They are chosen by different people for different reasons, they protect different things, and on many platforms they are configured in completely separate places. A candidate who answers this question by talking about how many replicas must confirm a write has answered a different question — a good one, but not this one. A second confusion: the coordination membership does not store records. Its state is the shape of the cluster — members, streams, partitions, ownership, settings — which is small in bytes and demanding in latency and durability of change. That is why sizing it looks nothing like sizing a record-serving node. ## How platforms differ Where the membership lives varies, and the sizing logic survives the variation: - where the role is an **internal membership** of the cluster's own members, you choose the count yourself and live with the arithmetic above; - where it is a **separate coordination service**, the same odd-and-small rule applies to that service's own members, and it is sized independently of how many brokers there are; - where the cluster is **rented and the role is hidden**, the provider made the choice; the arithmetic still governs what you experience, but the only thing you can observe is whether structural change is being admitted. ## What good answers sound like A strong answer states the rule (a majority must agree), does the arithmetic out loud for at least one even size, separates the coordination majority from write acknowledgement, and says that the membership does not scale with cluster size. A weak answer says "odd numbers avoid ties" and stops — which is not wrong as a slogan, but it misses that the fourth member also costs agreement on every change, and it gives no way to reason about three against five.

  • When would you prefer five members over three?
    When you want to take one member out deliberately — a patch, a machine replacement — and still survive an unplanned loss. With three, one member down leaves you one failure away from being unable to change anything, so every maintenance action on a coordination member becomes a tense operation.
  • Does the coordination membership grow when the cluster grows?
    No. More traffic means more record-serving nodes; the membership holding cluster state stays small because its job is agreement, not throughput. A large cluster is commonly coordinated by three or five members, and growing that number would slow every structural change while buying little.
  • How does this majority relate to the number of copies that must acknowledge a write?
    It does not. One governs whether cluster state may change, the other governs when a record counts as safely written. They are separate numbers, usually set in separate places, and tuning one tells you nothing about the other. Conflating them is the most common mistake on this subject.
  • Is an even-sized membership actually unsafe?
    Not unsafe — just wasteful. Four members are as correct as three; they simply need three to agree instead of two while still surviving one loss. You pay an extra machine and extra agreement work on every change for no additional tolerance.

A committee that can only sign when more than half its members are present. Adding a fourth signatory to a committee of three does not let one more be on holiday — it just means one more diary to chase for every signature.

saying these in an interview costs you the question

  • Says odd sizes merely avoid ties, with no account of agreement cost.
  • Thinks four members tolerate two losses because four is bigger than three.
  • Believes the membership must include every node in the cluster.
  • Answers with how many copies must acknowledge a write instead.
  • Assumes a bigger membership makes structural changes faster.
  • Thinks the coordination members need large disks because they hold state.