-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
KAFKA-16583: Handle PartitionChangeRecord without directory IDs #16118
Conversation
When PartitionRegistration#merge() reads a PartitionChangeRecord from an older MetadataVersion, with a replica assignment change and without #directories() set, it produces a direcotry assignment of DirectoryId.UNASSIGNED. This is problematic because the MetadataVersion may not yet support directory assignments, leading to a UnwritableMetadataException in PartitionRegistration#toRecord. Since the Controller always sets directories on PartitionChangeRecord if the MetadataVersion supports it, via PartitionChangeBuilder, there's no need for PartitionRegistration#merge() to populate directories upon a replica assignment change.
@soarez , thanks for the fix. It works now if I followed the steps in the JIRA. But then, after MV upgraded, this partition cannot change replica successfully. Here's the steps I did:
The logs in broker A:
Logs in controller:
So looks like in |
@showuon thanks for testing and sharing this. In those logs the controller is rejecting the assignment with a I'm thinking of two options:
I'm leaning towards option 2. since it's much simpler and there's no other case when |
I was trying to know the root cause of this problem, that why does it fail after upgrade, but not fail without upgrade. My understanding is that because before upgrade, the topic image doesn't have dirID for the assignment. After upgrade, the assignment has the dirID. So in the
So I think we might need to think about a good solution to fix from the root. I will create another ticket to track this issue. That said, I think this PR already fixed the issue in JIRA. Let's complete it! :) |
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.
LGTM!
KAFKA-16886 is created for above issue. I've set target to v3.7.1/v3.8.0. Thanks. |
@showuon Thanks for looking into this, and thanks for filing KAFKA-16886, I'll take that one. |
Failing tests are unrelated. Merging. |
When PartitionRegistration#merge() reads a PartitionChangeRecord from an older MetadataVersion, with a replica assignment change and without #directories() set, it produces a direcotry assignment of DirectoryId.UNASSIGNED. This is problematic because the MetadataVersion may not yet support directory assignments, leading to a UnwritableMetadataException in PartitionRegistration#toRecord. Since the Controller always sets directories on PartitionChangeRecord if the MetadataVersion supports it, via PartitionChangeBuilder, there's no need for PartitionRegistration#merge() to populate directories upon a replica assignment change. Reviewers: Luke Chen <showuon@gmail.com>
When PartitionRegistration#merge() reads a PartitionChangeRecord from an older MetadataVersion, with a replica assignment change and without #directories() set, it produces a direcotry assignment of DirectoryId.UNASSIGNED. This is problematic because the MetadataVersion may not yet support directory assignments, leading to a UnwritableMetadataException in PartitionRegistration#toRecord. Since the Controller always sets directories on PartitionChangeRecord if the MetadataVersion supports it, via PartitionChangeBuilder, there's no need for PartitionRegistration#merge() to populate directories upon a replica assignment change. Reviewers: Luke Chen <showuon@gmail.com>
…he#16118) When PartitionRegistration#merge() reads a PartitionChangeRecord from an older MetadataVersion, with a replica assignment change and without #directories() set, it produces a direcotry assignment of DirectoryId.UNASSIGNED. This is problematic because the MetadataVersion may not yet support directory assignments, leading to a UnwritableMetadataException in PartitionRegistration#toRecord. Since the Controller always sets directories on PartitionChangeRecord if the MetadataVersion supports it, via PartitionChangeBuilder, there's no need for PartitionRegistration#merge() to populate directories upon a replica assignment change. Reviewers: Luke Chen <showuon@gmail.com>
…he#16118) When PartitionRegistration#merge() reads a PartitionChangeRecord from an older MetadataVersion, with a replica assignment change and without #directories() set, it produces a direcotry assignment of DirectoryId.UNASSIGNED. This is problematic because the MetadataVersion may not yet support directory assignments, leading to a UnwritableMetadataException in PartitionRegistration#toRecord. Since the Controller always sets directories on PartitionChangeRecord if the MetadataVersion supports it, via PartitionChangeBuilder, there's no need for PartitionRegistration#merge() to populate directories upon a replica assignment change. Reviewers: Luke Chen <showuon@gmail.com>
When
PartitionRegistration#merge()
reads aPartitionChangeRecord
from an older MetadataVersion, with a replica assignment change and without#directories()
set, it produces a directory assignment ofDirectoryId.UNASSIGNED
. This is problematic because the MetadataVersion may not yet support directory assignments, leading to anUnwritableMetadataException
inPartitionRegistration#toRecord
.Since the Controller always sets directories on
PartitionChangeRecord
if the MetadataVersion supports it, viaPartitionChangeBuilder
, there's no need forPartitionRegistration#merge()
to populate directories upon a replica assignment change.