Skip to content

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

Merged
merged 4 commits into from
Apr 24, 2025

Conversation

apoorvmittal10
Copy link
Contributor

@apoorvmittal10 apoorvmittal10 commented Apr 22, 2025

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 required
additional 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

@github-actions github-actions bot added the triage PRs from the community label Apr 22, 2025
@github-actions github-actions bot added core Kafka Broker KIP-932 Queues for Kafka clients small Small PRs labels Apr 22, 2025
@apoorvmittal10 apoorvmittal10 added ci-approved and removed triage PRs from the community labels Apr 22, 2025
Copy link
Member

@AndrewJSchofield AndrewJSchofield left a 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.

@apoorvmittal10
Copy link
Contributor Author

apoorvmittal10 commented Apr 22, 2025

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.

@AndrewJSchofield
Copy link
Member

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.

Copy link
Contributor

@frankvicky frankvicky left a 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.

referenc: https://issues.apache.org/jira/browse/KAFKA-18934

@apoorvmittal10
Copy link
Contributor Author

Thanks @frankvicky. @AndrewJSchofield What do you think, should I remove the nullable and then later we update the KIP-932 or leave for future?

@AndrewJSchofield
Copy link
Member

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.

@frankvicky
Copy link
Contributor

Make sense to me.
We also need to update the KIP and notify the original email thread.

Copy link
Contributor

@frankvicky frankvicky left a 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." },
Copy link
Member

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.

Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

@AndrewJSchofield AndrewJSchofield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@apoorvmittal10 apoorvmittal10 merged commit 3c05dfd into apache:trunk Apr 24, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-approved clients core Kafka Broker KIP-932 Queues for Kafka small Small PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants