You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/11/20 22:17:23 UTC

[GitHub] [kafka] hachikuji opened a new pull request #9633: KAFKA-10706; Ensure leader epoch cache is cleaned after truncation to end offset

hachikuji opened a new pull request #9633:
URL: https://github.com/apache/kafka/pull/9633


   This patch fixes a liveness bug which prevents follower truncation from completing after a leader election. If there are consecutive leader elections without writing any data entries, then the leader and follower may have conflicting epoch entries at the end of the log. The JIRA explains a specific scenario in more detail: https://issues.apache.org/jira/browse/KAFKA-10706.
   
   The problem is the shortcut return in `Log.truncateTo` when the truncation offset is larger than or equal to the end offset, which prevents the conflicting entries from being resolved. Here we change this case to ensure `LeaderEpochFileCache.truncateFromEnd` is still called.
   
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] hachikuji commented on pull request #9633: KAFKA-10706; Ensure leader epoch cache is cleaned after truncation to end offset

Posted by GitBox <gi...@apache.org>.
hachikuji commented on pull request #9633:
URL: https://github.com/apache/kafka/pull/9633#issuecomment-731493312


   @junrao Thanks for reviewing. I pushed a minor tweak. I think we need to truncate the epoch cache even if the truncation offset is larger than the end offset. This is what would have happened in the example from the JIRA.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] hachikuji merged pull request #9633: KAFKA-10706; Ensure leader epoch cache is cleaned after truncation to end offset

Posted by GitBox <gi...@apache.org>.
hachikuji merged pull request #9633:
URL: https://github.com/apache/kafka/pull/9633


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org