-
Story
-
Resolution: Done
-
Major
-
AD482 - Early Access
-
None
-
-1
-
en-US (English)
URL:
Reporter RHNID:
Section: -
Language: en-US (English)|||||||||
Workaround:
Description: Ch02s06 step 2.2:
Partition 1 is one of the leaders. Leaders are the partitions that are responsible for reads and writes by default. Leaders and their followers are selected randomly
Feedback by Liam Clarke-Hutchinson:
Two issues here. # The replica on broker 1 is the leader for partition 1, so definitely remove/reword "Partition 1 is one of the leaders". Might be easier to use partition 2 or 3 as the example for point 3, to avoid any confusion with 1s and 0s
- I'm assuming "Leaders and their followers are selected randomly" is about how Kafka distributes partition leaders across the cluster when creating a topic?
Generally: # Kafka will aim to distribute replicas evenly across brokers.
- Then Kafka will aim to distribute partition leaders evenly across brokers
- When a leader is being elected, Kafka works from left to right through the ISR set. So in the example, where the replica on broker 0 is first in the ISR set, it's also the leader, ditto when the replica on broker 1 is first in the ISR set, it's the leader. So it's not random.
And likewise, should the leader fail, then the next preferred leader would again be the first replica in the ISR list.Rough example, my partition has 3 in sync replicas, {{
{2, 3, 1}}} - 2 is elected leader. When 2 fails, my ISR is now {{
{3, 1}}} so 3 will become leader.This behaviour enables cluster sysops or systems like Cruise Control to distribute partition leadership as they need.