Skip to content

KAFKA-20412: Fix prefixScan for KV-Store with headers#21971

Open
UladzislauBlok wants to merge 2 commits into
apache:trunkfrom
UladzislauBlok:bloku/kafka-20173-11
Open

KAFKA-20412: Fix prefixScan for KV-Store with headers#21971
UladzislauBlok wants to merge 2 commits into
apache:trunkfrom
UladzislauBlok:bloku/kafka-20173-11

Conversation

@UladzislauBlok

@UladzislauBlok UladzislauBlok commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Approach is similar to
MeteredTimestampedKeyValueStoreWithHeaders#delete(key)

validateStoreOpen();
final KeyValueIterator<Bytes, byte[]> storeIterator = wrapped().prefixScan(prefix, prefixKeySerializer);
final Bytes from = Bytes.wrap(prefixKeySerializer.serialize(null, prefix));
final Bytes from = Bytes.wrap(prefixKeySerializer.serialize(null, internalContext.headers(), prefix));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was thinking about this a little bit, and this change sounds generally ok to me.

But I would assume, that there is also other code (ie, other classes implementing prefixScan method that might need some updates, too?

Btw: we also just added CachingKeyValueStoreWithHeaders for which we might want to do this differently, ie, similar to what we did for put(key, null) -- ie, the change would not go into CachingKeyValueStoreWithHeaders but rather MeteredTimestampKeyValueStoreWithHeaders to modify the RecordContext set on the internalContext object. 🤔

@mjsax

mjsax commented Apr 8, 2026

Copy link
Copy Markdown
Member

We filed a new ticket to track the prefixScan work: https://issues.apache.org/jira/browse/KAFKA-20412 -- If you want to tackle it end-to-end, please assign the ticket to yourself, update the KAFKA-XXX number on this PR.

@mjsax mjsax added ci-approved and removed triage PRs from the community labels Apr 8, 2026
@UladzislauBlok UladzislauBlok changed the title KAFKA-20173: Propagate headers into serde: CachingKeyValueStore [WIP] KAFKA-20412: Propagate headers into serde: CachingKeyValueStore Apr 8, 2026
@UladzislauBlok UladzislauBlok deleted the bloku/kafka-20173-11 branch April 14, 2026 09:46
@UladzislauBlok UladzislauBlok restored the bloku/kafka-20173-11 branch April 14, 2026 09:48
@github-actions github-actions Bot added triage PRs from the community and removed triage PRs from the community labels Apr 14, 2026
@UladzislauBlok UladzislauBlok force-pushed the bloku/kafka-20173-11 branch from 05cd69b to f2eeb22 Compare May 17, 2026 19:07
@UladzislauBlok UladzislauBlok changed the title [WIP] KAFKA-20412: Propagate headers into serde: CachingKeyValueStore [WIP] KAFKA-20412: Fix prefixScan for KV-Store with headers May 17, 2026
@UladzislauBlok UladzislauBlok changed the title [WIP] KAFKA-20412: Fix prefixScan for KV-Store with headers KAFKA-20412: Fix prefixScan for KV-Store with headers May 23, 2026
@UladzislauBlok UladzislauBlok requested a review from mjsax June 13, 2026 12:25
@UladzislauBlok

Copy link
Copy Markdown
Contributor Author

@aliehsaeedii Hello
This PR was already waiting for some time. Can you take a look pls? It's fix for header-full prefix scan

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.

2 participants