I’m working (since 0.14 … ouch) on a storage engine/key-value store and have looked into it, if I could use Io for that. There are two main problems which arise in the commit protocol[1]:
- Some commit protocols(mine included) assume that one transaction only ever executes on one worker, because this makes it way easier to implement (and somewhat counterintuitively faster) because you don’t have to keep a complex dependency graph. This isn’t possible with the current work-stealing approach, as I understand it.
- Usually for most commit protocols you expect that all transactions, that were executed on the same worker, are already committed. This makes it again easy to track that these dependencies are committed(for me basically just a lamport clock). This isn’t possible by passing it with an argument.
If I could make wishes I would love there (1) to be a configuration to disable work-stealing - this might also be a good thing for other endeavours where you want precise control. And (2) to be able to get some notion of a worker. For the threaded implementation this is just a worker id. For fiber based ones this could either be the fiber id if they are never allowed to switch workers[2] or both the fiber id and the underlying worker id[3]. I haven’t really thought about how this would be handled with stackless coroutines but from intuition just the worker id could be enough. And (3) if I’m really impudent some way to control on which worker something executes.
The first 2 are basically a must for me and the 3rd is more wishful thinking.
Which decides whether a transaction can commit based on the dependencies it has and the already committed transactions. ↩︎
Which would be quite bad I think because this would basically introduce unnecessary allocations for resource management. ↩︎
Assuming fibers can switch workers, when they are finished/unused. Which at least for me isn’t work stealing because the fiber isn’t working at the moment. ↩︎