restate
restate copied to clipboard
Awakeable protocol changes
We should re-introduce the old design for awakeables used in service protocol <=4, that is when the user invokes ctx.awakeable() a completable command gets created, and when the user completes an awakeable a completion gets appended to the journal with the completion id encoded in the awakeable id.
Plan
- When user creates awakeable in code,
AwakeableCommandMessagegets proposed, and the user gets an id.- We need this id to be a new type of awakeable id, as we can't reuse the previous ones:
prom1was for journal v1,sign1is for signals in journal v2. The new id should start with awk to identify it is about awakeables.
- We need this id to be a new type of awakeable id, as we can't reuse the previous ones:
- If the user completes from SDK, then
CompleteAwakeableCommandMessagegets reused. Note that in there there is an enum type for the different awakeable ids, that needs to support the new awakeable id: https://github.com/restatedev/restate/blob/347e62008b4b3ee2721f7a3a5ea909fc2923988c/crates/types/src/journal_v2/command.rs#L382 - When completing awakeables, we need a new wal command to distinguish the new awakeable implementation (Previous awakeable implemetnations used InvocationResponse and Signal). This command is also proposed by the InvocationClient when the user provides the new awakeable id in the ingress.
Service protocol
https://github.com/restatedev/sdk-shared-core/commit/e7c1e7303bd45f9270111e80026cee1d3ef57d9e
Runtime
- [ ] Service protocol changes
- [ ] Protocol V7 bump + experimental feature env var to enable it in tests
- [ ] Introduce new Awakeable id
- [ ] Implement new service protocol messages
- [ ] Implement new new wal command for completing awakeables
- [ ] Make sure awakeable completion works both through SDK and ingress