KAFKA-21317: Continue timestamp search across eligible log segments by shantanukawale-stripe · Pull Request #23880 · apache/kafka · GitHub
Skip to content

KAFKA-21317: Continue timestamp search across eligible log segments - #23880

Open
shantanukawale-stripe wants to merge 1 commit into
apache:trunkfrom
shantanukawale-stripe:fix-unified-log-timestamp-search
Open

shantanukawale-stripe wants to merge 1 commit into
apache:trunkfrom
shantanukawale-stripe:fix-unified-log-timestamp-search

Conversation

@shantanukawale-stripe

@shantanukawale-stripe shantanukawale-stripe commented Oct 20, 2026 •

Copy link
Copy Markdown

After the log start offset advances into a segment, its cached largest timestamp can come from a record below the new start offset. The per-segment timestamp lookup correctly returns empty when no retained record matches, but UnifiedLog currently returns that empty result without checking later segments that may contain a valid match.

Continue searching eligible segments until a lookup returns a result. Preserve the one-time segment snapshot and use in-memory base offsets to skip obsolete segments without reading segment tails. Add a file-backed, two-segment regression with non-monotonic timestamps and a log start offset inside the first segment.

Jira: https://issues.apache.org/jira/browse/KAFKA-21317

After the log start offset advances into a segment, an expired record can leave that segment eligible by timestamp even though its retained records do not match. Continue into later eligible segments and skip wholly obsolete segments using the cached segment base offsets.

Generated-by: OpenAI Codex (GPT-5)
@shantanukawale-stripe

Copy link
Copy Markdown
Author

@github-actions github-actions Bot added triage PRs from the community storage Pull requests that target the storage module small Small PRs labels Oct 20, 2026
@shantanukawale-stripe

Copy link
Copy Markdown
Author

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

Labels

small Small PRs storage Pull requests that target the storage module triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant