-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Giving state machine implementers a way to opt out from being forced to support snapshotting at arbitrary offset. #22961
Giving state machine implementers a way to opt out from being forced to support snapshotting at arbitrary offset. #22961
Conversation
a1851b0
to
c8283f1
Compare
/dt |
c8283f1
to
c17b5ec
Compare
/dt |
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/53602#019193b1-20d6-4740-9737-9fd1aca2dbd2 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/53695#019199cb-0acd-444d-8bbb-23f3bd6ba32a ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/53695#019199cd-d871-49bf-ae6a-ce3860d0f08e ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/53822#0191a41a-6659-4881-b076-f35ed6756a12 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/55625#01924c29-032f-4ba2-ade0-25a163f93c5c ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/55625#01924c29-0331-4189-8a21-8ef6ec430b34 |
new failures in https://buildkite.com/redpanda/redpanda/builds/53602#019193b3-0ea3-41ce-8ec9-9a413ad3ab3f:
new failures in https://buildkite.com/redpanda/redpanda/builds/55625#01924c29-032d-4627-8e5c-a7d90a1ac7b3:
|
c17b5ec
to
6f3b742
Compare
/dt |
6f3b742
to
9f33cd1
Compare
/dt |
9f33cd1
to
73e0120
Compare
/dt |
73e0120
to
41a0e32
Compare
/dt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few minor comments.
ace577b
to
122e87f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
A note on commit history: looks like every commit has the same commit message and I think the last two commits should be squashed, otherwise compilation is broken in the middle commit?
if (offset != last_applied_offset()) { | ||
throw std::logic_error(fmt::format( | ||
"State machine that do not support taking snapshot at arbitrary " | ||
"offset can to take snapshot at requested offset: {}, current " | ||
"last applied offset: {}", | ||
offset, | ||
last_applied_offset())); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_apply_units are held by this point, right? Reason I'm asking is because of scheduling points if the units are not held last_applied() may change from L136 and L144. But AFAICT thats not a concern given the units.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, exactly the units are held in the state_machine_manager
To support fast partition movement in Redpanda the `raft::state_machine_base` interface requires state machine implementer to provide support for taking snapshot at arbitrary, already applied offset. This requirement is easy to achieve for all existing state machines as they do not require raft snapshots at all. In future we may leverage the Raft protocol snapshot as they provide a nice way to maintain the bounded log size without compromising consistency. This PR introduces changes to `state_machine_manager` and `state_machine_base` interfaces allowing state machine implementer to opt out from the requirement to provide snapshot at offset capability. Without this feature the partition that the STM is build at will not be fast movable but the `take_snapshot` implementation will be very simple as it will require simply serializing the current in memory state of the state machine. Signed-off-by: Michał Maślanka <[email protected]>
122e87f
to
0f26b8f
Compare
/ci-repeat 1 |
To support fast partition movement in Redpanda the
raft::state_machine_base
interface requires state machine implementerto provide support for taking snapshot at arbitrary, already applied
offset. This requirement is easy to achieve for all existing state
machines as they do not require raft snapshots at all.
In future we may leverage the Raft protocol snapshot as they provide a
nice way to maintain the bounded log size without compromising
consistency.
This PR introduces changes to
state_machine_manager
andstate_machine_base
interfaces allowing state machine implementer toopt out from the requirement to provide snapshot at offset capability.
Without this feature the partition that the STM is build at will not be
fast movable but the
take_snapshot
implementation will be very simpleas it will require simply serializing the current in memory state of the
state machine.
Backports Required
Release Notes