Predict the output
Partition end offsets and committed offsets for a group. What's the total lag?
end = {0: 1200, 1: 980, 2: 1500}
committed = {0: 1200, 1: 900, 2: 1100}
print(sum(end[p] - committed[p] for p in end))Hint 1 of 1
Lag is end minus committed, per partition.
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A 480
Correct. 0 + 80 + 400; partition 2 is where the problem is.
Lag per partition is the end offset minus the committed offset: 0, 80 and 400. The total is 480, and per-partition numbers show which partition is stuck.
Why not the others?
- B
400. Partition 1 is also 80 behind. - C
3680. That's the sum of end offsets. - D
0. Only partition 0 is caught up.