Skip to content

Conversation

@twmb
Copy link
Owner

@twmb twmb commented Nov 20, 2025

The metadata update was added originally with the thinking that we needed the most up to date metadata so that we could issue these requests correctly.

I think automatic request sharding came later? Not sure, but anyway, ListOffsets and OffsetForLeaderEpoch don't use the metadata that that triggerUpdateMetadata updates anyway: triggerUpdateMetadata updates the main metadata used for producing & consuming, whereas all admin requests use a cached metadata. The cache already evicts topics or partitions that have errors.

Point is, the metadata update in listOrEpoch, at this point, existed only to have a bit of a pause to collapse many listOrEpoch calls into one chunk of running logic.

Removing the whole metadata updating makes it easier to reason about (do we need to update metadata now, or later?), and we can keep the same listOrEpoch coalescing behavior by waiting 5s on retries and merging ever listOrEpoch that fires during those 5s.

It's possible that users may see 5s pauses in some scenarios where they previously would not: a retry may pause things while other non-retry requests are trying to come in. In general we can point to retry collapsing being better anyway, but if the need arises, we can separate the wait to ONLY happen on requests that are retrying, and to ALWAYS allow non-retrying requests to go through ASAP with no merging.

@twmb twmb changed the title kgo: avoid updating metadata before issuing ListOffsets / OffsetForLe… kgo: avoid updating metadata before issuing ListOffsets / OffsetForLeaderEpoch Nov 20, 2025
…aderEpoch

The metadata update was added originally with the thinking that we
needed the most up to date metadata so that we could issue these
requests correctly.

I *think* automatic request sharding came later? Not sure, but anyway,
ListOffsets and OffsetForLeaderEpoch don't use the metadata that that
triggerUpdateMetadata updates anyway: triggerUpdateMetadata updates the
main metadata used for producing & consuming, whereas all admin requests
use a cached metadata. The cache already evicts topics or partitions
that have errors.

Point is, the metadata update in listOrEpoch, at this point, existed
only to have a bit of a pause to collapse many listOrEpoch calls into
one chunk of running logic.

Removing the whole metadata updating makes it easier to reason about
(do we need to update metadata now, or later?), and we can keep the same
listOrEpoch coalescing behavior by waiting 5s on retries and merging
ever listOrEpoch that fires during those 5s.

It's possible that users may see 5s pauses in some scenarios where they
previously would not: a retry may pause things while other non-retry
requests are trying to come in. In general we can point to retry
collapsing being better anyway, but if the need arises, we can separate
the wait to ONLY happen on requests that are retrying, and to ALWAYS
allow non-retrying requests to go through ASAP with no merging.
@twmb twmb merged commit 2698ed0 into master Nov 23, 2025
16 checks passed
@twmb twmb deleted the meta-less branch November 23, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants