penberg / limbo

Limbo is a work-in-progress, in-process OLTP database management system, compatible with SQLite.
MIT License
896 stars 49 forks source link

Make I/O completion explicit #135

Open penberg opened 1 month ago

penberg commented 1 month ago

We currently rely on run_once() completing I/O. However, this is not guaranteed to be correct because I/O request can be reordered, for example, by the kernel. We should keep track of in-flight completions in ProgramState, for example, and then make sure the <opcode>Await bytecodes check that their completion is done before allowing to proceed.

JoanFM commented 1 month ago

is the reordering the problem? since I see the readiness is based on the callback right?.

JoanFM commented 1 month ago

Is the issue right now that after an NextAsync or any Async operation, u rely on someone getting an IO result and run the io.run_once ?

JoanFM commented 1 month ago

I believe these run_once should be moved to the Await operations, in a way that the CQ is consumed until the required one by the operation is obtained.