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 epoch is the minimum expected epoch for the message at the fetch offset. The leader will use its leader epoch cache to validate that the epoch and fetch offset are correct. Specifically, it will ensure that there does not exist a leader epoch which is larger than that the fetch leader epoch, but which starts are no larger leader epochs which began at a smaller offset than the fetch offset. This implies would imply that the consumer did not see some messages from the later epoch, which means the log was truncated at some point. The leader will return a new LOG_TRUNCATION error code in this case. 

...