restatedev / restate

Restate is the platform for building resilient applications that tolerate all infrastructure faults w/o the need for a PhD.
https://docs.restate.dev
Other
1.28k stars 32 forks source link

[Storage] Transaction doesn't support read your own writes #851

Open slinkydeveloper opened 8 months ago

slinkydeveloper commented 8 months ago

Currently the RocksDBTransaction type doesn't support read your own writes. Due to that we cannot process batch of effects, e.g. we cannot create a virtual journal and append an entry afterwards.

This is currently an issue for the RemoteContext and the NBIS, but it is also a potential cause of bugs in future in case we start batching events from the invoker, or if we start receiving batch of commands from the consensus algorithm.

slinkydeveloper commented 8 months ago

One solution would be to modify RocksDBTransaction to support read your own writes transparently, and then take a batch of commands and loop each command through StateMachine::process committing the transaction, and processing the Action, only at the end.