Skip to content
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/group: don't replicate empty batch on offset commit #22824

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

andrwng
Copy link
Contributor

@andrwng andrwng commented Aug 9, 2024

Redpanda generally does not permit empty batches to make their way to
the log. This is problematic in case of an empty offset commit requests.

Kafka returns immediately for empty requests[1], so this tweaks the
return store_offsets() method to do the same. I considered putting this
higher up in the Kafka layer, but there didn't seem to be a specialized
handler for offsets commits where such an early return would be natural.

[1] https://github.com/apache/kafka/blob/98cdf9717049e87ba34bb5161276577fcb8bd1c4/core/src/main/scala/kafka/server/KafkaApis.scala#L504-L505

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v24.2.x
  • v24.1.x
  • v23.3.x

Release Notes

Bug Fixes

  • Fixes a bug in which empty offset commit requests could result in a crash.

@andrwng andrwng force-pushed the group-offset-commit-empty branch from 4b66565 to e751117 Compare August 9, 2024 21:51
@andrwng andrwng marked this pull request as ready for review August 9, 2024 21:51
Redpanda generally does not permit empty batches to make their way to
the log. This is problematic in case of an empty offset commit requests.

Kafka returns immediately for empty requests[1], so this tweaks the
return store_offsets() method to do the same. I considered putting this
higher up in the Kafka layer, but there didn't seem to be a specialized
handler for offsets commits where such an early return would be natural.

[1] https://github.com/apache/kafka/blob/98cdf9717049e87ba34bb5161276577fcb8bd1c4/core/src/main/scala/kafka/server/KafkaApis.scala#L504-L505
@andrwng andrwng force-pushed the group-offset-commit-empty branch from e751117 to c0b2fc7 Compare August 9, 2024 21:53
@vbotbuildovich
Copy link
Collaborator

vbotbuildovich commented Aug 10, 2024

Copy link
Contributor

@WillemKauf WillemKauf left a comment

Choose a reason for hiding this comment

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

nice

@bharathv bharathv merged commit 471135d into redpanda-data:dev Aug 15, 2024
19 checks passed
@vbotbuildovich
Copy link
Collaborator

/backport v24.2.x

@vbotbuildovich
Copy link
Collaborator

/backport v24.1.x

@vbotbuildovich
Copy link
Collaborator

/backport v23.3.x

Copy link
Member

@dotnwat dotnwat left a comment

Choose a reason for hiding this comment

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

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants