Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To fix this problem, we propose to include in each fetch request the epoch returned in the last fetch in order to ensure that the fetched offset reflects the expected state of the log from the fetcher's perspective. This is not the last epoch is the minimum expected epoch for the message at the fetch offset. The leader will then use its leader epoch cache to verify 1) whether the expected actual epoch is correct or whether the log has been truncated. greater than or equal to the epoch in the fetch request, and 2) if the epoch is greater than the minimum expected epoch, that the new epoch does not begin at an earlier offset than the fetch offset.  In the latter case, the leader can respond with a new LOG_TRUNCATION error code to indicate that truncation has occurred. The consumer and the replica would handle this slightly differently, but basically they would first try to find the point in the log of divergence. Below we discuss how the behavior changes for clients, leaders, and followers.

...