restate icon indicating copy to clipboard operation
restate copied to clipboard

Awakeable protocol changes

Open slinkydeveloper opened this issue 3 months ago • 0 comments

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, AwakeableCommandMessage gets 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: prom1 was for journal v1, sign1 is for signals in journal v2. The new id should start with awk to identify it is about awakeables.
  • If the user completes from SDK, then CompleteAwakeableCommandMessage gets 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

slinkydeveloper avatar Nov 10 '25 10:11 slinkydeveloper