-
Notifications
You must be signed in to change notification settings - Fork 55
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
Service Protocol V4 and Immutable journal #2476
Merged
slinkydeveloper
merged 23 commits into
restatedev:main
from
slinkydeveloper:immutable-journal
Jan 24, 2025
Merged
Service Protocol V4 and Immutable journal #2476
slinkydeveloper
merged 23 commits into
restatedev:main
from
slinkydeveloper:immutable-journal
Jan 24, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d66ad00
to
64060ad
Compare
a7f22ec
to
7101298
Compare
Good news! All the feature tests for protocol V4 on our WIP python SDK branch are passing! |
de7778a
to
59356bc
Compare
This contains the materialized data model `Entry` and the stored data model `RawEntry`
…d not update this protobuf anymore
…ntroduce new ExternalSignalIdentifier used to complete awakeables created by journals using journal table V2.
…e contains the entry codec and the message codec of the new service protocol. To simplify code generation, I also moved in a parent directory the service-protocol. Eventually we use this directory as ground truth of the protocol, and we sunset https://github.com/restatedev/service-protocol
* Add JournalTableV2, used for the new service protocol * Expand InvocationStatus to hold, in the suspended state the _awaiting on notification_ information * Add OutboxMessage::NotifySignal (this change is a bit pointless, see restatedev#2484)
* This adds few new effects, such as JournalEntryV2 and SuspendedV2 to carry the new journal info. * The ServiceProtocolRunnerV4 is a copy of the previous ServiceProtocolRunner, but using the new message and entry types. There is no respective EntryEnricher for Journal V2, as it was a useless abstraction. * The JournalReader interface can read both the old and the new journal. If the service protocol uses version 4, an in-flight migration of the input entry is executed by the ServiceProtocolRunnerV4 * Few changes were needed in the InvocationStateMachine to support the new cases to wait for retries, notably if we propose a run completion, then we need to wait for that to be pushed in the journal before retrying.
* Changes all the receivers to receive on StateMachineContext with self. This helps the new state machine for now, albeit we should remove all these methods in future. * Added branching points with new state machine.
… from protocol V3
59356bc
to
edac676
Compare
igalshilman
approved these changes
Jan 24, 2025
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.
Tested this locally with the verification test. Mixed protocols v4 and v3.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements the ServiceProtocol V4 and the immutable journal (often referred in the codebase as Journal V2 or Journal Table V2).
The Immutable Journal is a rework of the journal model, splitting commands and completions in distinct entries. The commit c484925 defines the new data model, which roughly works as follows:
In order to implement the new protocol and the immutable journal, there are two places where most of the interesting stuff happens:
mod.rs
file.PinnedDeployment
effect we perform, if needed, a migration from the old table to the new table. This enforces the following invariants:PinnedDeployment
effect. To solve this case, I introduced a new id scheme calledExternalSignalIdentifier
, which will be produced only by SDKs using service protocol v4.PinnedDeployment
effect. In this case, the journal contains only the input entry, thus we can ignore the cancel for now.The storage changes are minimal (commit 2ba04cc), they add a
JournalTableV2
which is very similar to the oldJournalTable
, but uses the new data model and adds a reverse index from notification id to notification and from completion id to command.There are few other code organization changes that have been made in this PR and will need subsequent work to finalize:
/service-protocol
.This PR misses the following, which will be tackled in followups:
Wiring the new journal table to datafusionUnit test coverage of the new state machine