mirror of https://github.com/apache/kafka.git
This patch refactors the `Partition.makeLeader` and `Partition.makeFollower` to be robust to all partition updates from the KRaft metadata log. Particularly, it ensures the following invariants: - A partition update is accepted if the partition epoch is equal or newer. The partition epoch is updated by the AlterPartition path as well so we accept an update from the metadata log with the same partition epoch in order to fully update the partition state. - The leader epoch state offset is only updated when the leader epoch is bumped. - The follower states are only updated when the leader epoch is bumped. - Fetchers are only restarted when the leader epoch is bumped. This was already the case but this patch adds unit tests to prove/maintain it. In the mean time, the patch unifies the state change logs to be similar in both ZK and KRaft world. Reviewers: Jason Gustafson <jason@confluent.io> |
||
---|---|---|
.. | ||
src | ||
.gitignore |