-
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: fix PartitionRegistration#toRecord directory check under metadata version 3_7_IV2 #15751
Conversation
… metadata version 3_7_IV2 Signed-off-by: Robin Han <hanxvdovehx@gmail.com>
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
Thanks for fixing this issue. I'll take a look this week or next week. |
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.
@superhx , thanks for the fix! Could you please add some tests for this change?
@soarez , could you have another look at this PR since you're the expert in KRaft JBOD? |
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.
Thanks for finding the bug and filing a PR.
I don't think this approach is correct. Before the metadata supports directory assignment only Directory.MIGRATING should be used which is also the default in the metadata records.
The issue JIRA states:
When reassigning partition, PartitionRegistration#merge will set the new replicas with UNASSIGNED directory
Before IBP_3_7_IV2
this shouldn't happen. I think that's the root cause of the issue here.
Pass the |
Can you please confirm:
This is the stack trace in the JIRA:
It shows that:
Neither controllers nor brokers pre 3.7 produce records with directory IDs, the only possible value in previous records is
From these two approaches, I prefer the second one, it’s not only a simpler change but also removes redundant logic. |
yes
default value |
The complexity of this repair seems to have exceeded my abilities. Perhaps it would be more suitable for you to fix it. @soarez |
I've filed PR #16118 |
fix https://issues.apache.org/jira/browse/KAFKA-16583
Committer Checklist (excluded from commit message)