Skip to content

Conversation

@BenPope
Copy link
Member

@BenPope BenPope commented May 15, 2025

NOTE: Do not merge, just running this against the full test suite.

When a topic is created, it is added to metadata_cache prior to having a leader. The leader_epoch is 0, which can conflict with a previous topic of the same name.

After voting, the term_id is set correctly, resulting in a correct leader_epoch, which allows a consumer to detect the change.

This commit detects that a topic is new by not returning partitions that have never had a leader; if there are no partitions, the topic is rejected as unknown.

TODO:

  • Write tests

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
  • v25.1.x
  • v24.3.x
  • v24.2.x

Release Notes

Features

  • kafka/server: Support metadata v9

When a topic is created, it is added to metadata_cache prior to
having a leader. The leader_epoch is 0, which can conflict with
a previous topic of the same name.

After voting, the term_id is set correctly, resulting in a correct
leader_epoch, which allows a consumer to detect the change.

This commit detects that a topic is new by not returning partitions
that have never had a leader; if there are no partitions, the topic
is rejected as unknown.

Signed-off-by: Ben Pope <ben@redpanda.com>
@BenPope
Copy link
Member Author

BenPope commented Sep 11, 2025

Closed by #26968

@BenPope BenPope closed this Sep 11, 2025
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.

1 participant