Skip to content

Conversation

@shan305
Copy link

@shan305 shan305 commented Dec 31, 2025

While reading through Sender.handleProduceResponse, I wanted to double-check my understanding of how produce responses are matched back to ProducerBatch instances.

From what I can tell, the matching logic prefers topicId when present (v13+), and otherwise falls back to topic name + partition, using a topic-name snapshot captured before the request is sent.

This makes sense, but I wanted to confirm the intended guarantees here, especially since metadata can change while a produce request is in flight (for example: topic recreation or leadership changes).

In particular, I’m trying to understand:

  • Whether we rely on the pre-send topic snapshot to always resolve a non-zero topicId in the response
  • Whether a batch == null case is considered impossible by design, or treated as a deliberate hard failure

No behavior change proposed yet — opening this mainly to confirm assumptions before going any deeper.

@github-actions github-actions bot added triage PRs from the community docs small Small PRs labels Dec 31, 2025
@shan305
Copy link
Author

shan305 commented Dec 31, 2025

Keeping this as a draft for now since this is primarily a design / behavior question.
Happy to follow up with a concrete change (or tests) once assumptions are confirmed.

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

Labels

docs small Small PRs triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants