Skip to content

Conversation

@nicktelford
Copy link
Contributor

@nicktelford nicktelford commented Nov 21, 2025

These are the new interfaces detailed in KIP-1035: "StateStore managed
changelog offsets".

This PR introduces the interfaces changes, but makes otherwise no
consequential behavioural changes.

Outside of StateStore.java, all changes are essentially just a
rename of all invocations of StateStore#flush to instead call
StateStore#commit.

The changelogOffsets being passed in these invocations is currently
unused: the behaviour of StateStore#commit remains identical to
StateStore#flush before these changes.

A new implementation of StateStore#commit that actually uses these
offsets, along with changes to the use-site (in ProcessorStateManager
and GlobalStateManager) will come in a later PR.

Many strings, including documentation, and some variable names, have
also been renamed (from "flush" to "commit"), to maintain consistency
with the method they relate to.

One exception is the flush-rate metric, which has not been renamed,
because it will instead be deprecated in favour of a new commit-rate
metric, which will be introduced in another PR.


The only change in behaviour is as follows: calling StateStore#flush
from within a Processor is now a guaranteed no-op.

In the future, this will throw an UnsupportedOperationException, but
to ensure no changes to end-user experience, we currently make it a
no-op.

Previously, any call to StateStore#flush from a Processor would have
made no difference to program semantics, but likely would introduce
performance problems for RocksDB. This is because it would force a flush
of RocksDB memtables to disk on every invocation, which if naively used
could be on every Record.

Consequently, making this a no-op should not make a difference for
end-users, except potentially improving performance if they were
incorrectly calling this method.

These are the new interfaces detailed in KIP-1035: "StateStore managed
changelog offsets".

This PR introduces the interfaces changes, but makes otherwise no
consequential behavioural changes.

Outside of `StateStore.java`, _all_ changes are essentially just a
rename of all invocations of `StateStore#flush` to instead call
`StateStore#commit`.

The `changelogOffsets` being passed in these invocations is currently
unused: the behaviour of `StateStore#commit` remains identical to
`StateStore#flush` before these changes.

A new implementation of `StateStore#commit` that actually uses these
offsets, along with changes to the use-site (in `ProcessorStateManager`
and `GlobalStateManager`) will come in a later PR.

Many strings, including documentation, and some variable names, have
also been renamed (from "flush" to "commit"), to maintain consistency
with the method they relate to.

One exception is the `flush-rate` metric, which has not been renamed,
because it will instead be deprecated in favour of a new `commit-rate`
metric, which will be introduced in another PR.

---

The only change in behaviour is as follows: calling `StateStore#flush`
from within a `Processor` is now a guaranteed no-op.

In the future, this will throw an `UnsupportedOperationException`, but
to ensure no changes to end-user experience, we currently make it a
no-op.

Previously, any call to `StateStore#flush` from a `Processor` would have
made no difference to program semantics, but likely would introduce
performance problems for RocksDB. This is because it would force a flush
of RocksDB memtables to disk on every invocation, which if naively used
could be on _every_ `Record`.

Consequently, making this a no-op should not make a difference for
end-users, except potentially improving performance if they were
incorrectly calling this method.
@github-actions github-actions bot added triage PRs from the community streams labels Nov 21, 2025
@github-actions
Copy link

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

Copy link
Member

@bbejeck bbejeck left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @nicktelford - I made a pass and it overall looks good, since this has been around for some time, can you rebase?

@github-actions github-actions bot removed needs-attention triage PRs from the community labels Jan 10, 2026
@bbejeck bbejeck changed the title KAFKA-14711: Add new StateStore interfaces KAFKA-17411: Add new StateStore interfaces Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants