pa-04 — Verification
One command
cd pa-04-partitioned-log && bash scripts/verify.sh
What the tests prove
| Test | Invariant |
|---|---|
TestKeyMapsToSamePartition | a key always hashes to the same partition (ordering guarantee) |
TestPerPartitionOrdering | records for a key keep order via monotonic offsets |
TestConsumeFromOffset | consume returns records at/after an offset; HW is correct |
TestConsumerGroupOffsets | commit/resume works; groups are independent |
TestRangeAssignment | 5 partitions / 2 consumers → contiguous ranges, earlier gets the extra |
TestRoundRobinAssignment | 5/2 → round-robin distribution |
TestRetentionKeepsOffsetsStable | truncation drops old records; survivors keep absolute offsets; HW unchanged |
All under -race.
What "green" does NOT guarantee
- In-memory, single-node. Production replicates partitions (leader/follower, db-17) with durable segments.
- No sticky rebalancing / transactions. Range/round-robin only; minimal-movement reassignment is an exercise.
- No consumer-lag alerting wired — the SLI is an exercise (pa-09).