-
Notifications
You must be signed in to change notification settings - Fork 14.5k
KAFKA-18889: Make records in ShareFetchResponse non-nullable #19536
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
Conversation
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.
Should the records
field in the ShareFetchResponse.json
be non-nullable too? I notice that it permits nulls.
So in this PR: https://github.com/apache/kafka/pull/19131/files the field was made nullable again. I aligned the changes as per regular Fetch behaviour. |
I know there was some back and forth about the regular Fetch because of legacy clients, but I don't think we are impeded by those at all. |
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.
The general idea from #18726 (comment) is that we will make FetchResponse not return null records through a KIP.
I'm not sure we need a KIP for the shared fetch response since Queue for Kafka is still in development.
Thanks @frankvicky. @AndrewJSchofield What do you think, should I remove the nullable and then later we update the KIP-932 or leave for future? |
My view is that we remove the nullable now. It would be worth having a quick check to see what difference is made in the generated code, but really if we do not want null values, we should take that step now so the non-Java clients are written with the right expectations too. |
Make sense to me. |
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.
@apoorvmittal10: Thanks for the patch.
LGTM
@@ -67,7 +67,7 @@ | |||
{ "name": "LeaderEpoch", "type": "int32", "versions": "0+", | |||
"about": "The latest known leader epoch." } | |||
]}, | |||
{ "name": "Records", "type": "records", "versions": "0+", "nullableVersions": "0+", "about": "The record data." }, | |||
{ "name": "Records", "type": "records", "versions": "0+", "about": "The record data." }, |
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.
Technically, that would be "nullableVersions": "0"
I suppose. It was nullable in v0. We are now in v1.
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.
the v0 is not available for now, so it should be fine to remove nullableVersions
?
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.
Well, yes, unless we are looking to have the JSON file document what was previously there too for v0. Otherwise, we could entirely remove all mention of v0, which we did not do.
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.
@AndrewJSchofield I added the suggestion, only specific to version 0.
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
This PR marks the records as non-nullable for ShareFetch.
This PR is as per the changes for Fetch:
#18726 and some work for ShareFetch
was done here: #19167. I tested with
marking
records
as non-nullable in ShareFetch, which requiredadditional handling. The same has been fixed in current PR.
Reviewers: Andrew Schofield aschofield@confluent.io, Chia-Ping Tsai
chia7712@gmail.com, TengYao Chi frankvicky@apache.org, PoAn Yang
payang@apache.org