-
Notifications
You must be signed in to change notification settings - Fork 15.1k
KAFKA-6361: Fix log divergence between leader and follower after fast leader fail over #4882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
5ea4672
KAFKA-6361: Fix log divergence between leader and follower after fast…
apovzner 00bca81
set EpochEndOffset.UNDEFINED_EPOCH default to NO_PARTITION_LEADER_EPO…
apovzner bc51478
some cleanup and tests
apovzner 4fce82f
Few small fixes to truncation logic
apovzner 2f6cf3b
fixed merge errors
apovzner c69e85e
Fixed build failures and fixed logging
apovzner ab86ba3
Updated comments based on review comments
apovzner b2be14d
Updated the upgrade doc and minor fixes in comments
apovzner 4dc679c
Addressed review comments in tests
apovzner 818d29e
Truncate based on protocol version
apovzner a781aba
Moved common truncation logic to method in base class
apovzner ba620c2
Added test for truncation logic for protocol version < 2.0
apovzner d05e50d
Added test for truncating to largest common epoch in ReplicaAlterLogD…
apovzner 5a290a9
removed dup test due to merge, small cleanup to address couple of com…
apovzner a71f6cd
Bounding future replica HW to its LOE, and some more cleanup to addre…
apovzner bcced69
fixes to comments and log
apovzner 6ccaa51
updated unit test to properly simulate both brokers on older protocol…
apovzner ca63ae1
Various small fixes addressing review comments
apovzner b800cb5
Creating OffsetsForLeaderEpochRequests with version
apovzner 64031fc
Minor changes to address review comments
apovzner 4503ab4
Future replica truncation is consistent with protocol version
apovzner e5ad61f
future replica always uses leader epoch for truncation if available
apovzner 84dc51e
reverted incorrect warn about truncating below HW
apovzner 544f4fd
Output warning if truncating below HW
apovzner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this affects inter broker protocol, we need to (1) document this api change for "2.0-IV0" in ApiVersion.scala, (2) update the upgrade section in the doc, (3) only use the new protocol if the inter broker protocol is 2.0-IV0 or above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done all three.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding (3), the fetcher falls back to KIP-101 logic if inter-broker protocol version < KAFKA_2_0_IV0 (ignores leader epoch returned in the response and uses end offset).