Try
↑ ↓ move↵ openesc close

Partitioned log lab

A keyed topic split into partitions and read by a consumer group. Watch ordering, lag, idle consumers, a hot key, a rebalance pause and a replay from the start.

4 consumers, 4 partitionsworking consumers = min(C, P) = 4Group drains at most 6.0 messages per tick, if every partition has work.

Last event: group formed.

Partitions: lag is the gap between the end of the log and the consumer

  • P0C10
  • P1C20
  • P2C30
  • P3C40

Bars share one scale. A star marks the partition that holds the hot key. Lag is counted from the consumer's position; tools usually count from the committed offset, which trails by up to one commit interval.

Consumers in the group

  • C1P0122 done
  • C2P189 done
  • C3P297 done
  • C4P392 done
produced
400
total lag
0
worst partition lag
0
hot key partition share
24%
same-key order breaks
0
cross-key order breaks
193
re-read after rebalance or replay
0
rebalances
00 ticks paused
Lag over time
Lag over time. Text version available below the chart.01345tick 5tick 55tick 100ticksmessages behind

What to try

Each one sets up a starting point. Then make the change it describes.

  1. Order holds inside a partition only

    Run the default group for a while and read the two order counters.

    Look for. Same-key order breaks stay at zero, because every message of a key sits in one partition and is read in order. Cross-key order breaks keep climbing, since partitions are read in parallel.

  2. More consumers than partitions

    Raise the starting consumers to 8 with 4 partitions.

    Look for. Four consumers own a partition each and four sit idle. Throughput and lag are the same as with four consumers.

  3. One hot key skews one partition

    Give half the messages to a single key, then raise the consumers to 12.

    Look for. One partition piles up lag while the rest stay empty. A partition has one owner, so extra consumers cannot share that work.

  4. A rebalance stops everyone

    Press "A consumer leaves" and watch the status line and the lag chart.

    Look for. Every partition is revoked for the length of the pause, so lag grows on all of them at once. When it ends, each partition resumes from its committed offset and the work since that commit is read again.

  5. Replay the log

    Press "Replay from the earliest offset" and watch lag, the re-read counter and the order counters.

    Look for. The group reads everything the log still holds a second time. Lag jumps, then drains. A log keeps messages after they are read, so a replay needs no help from the producers.

New to the idea? Read the lesson first. Every number here comes from a seeded simulator, so the same seed gives the same run.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms