channable/icepeak

Allow requests with some sort of durability guarantee

fatho opened this issue · 2 comments

fatho commented

Currently, requests to the HTTP API post the command to the core queue and then immediately return. This could lead to a situation where a GET following a PUT returns stale data.

The proposal is to add a durable URL parameter that causes PUT and DELETE requests to wait until the modification has been applied to the data store. The easiest way is probably to create a new MVar in the request and pass it along the modification in the corresponding command:

| Modify Modification

would become

 | Modify Modification (Maybe (MVar ()))

The Nothing case would behave as before, in the Just case, the MVar is filled after the modification has been processed and the request handler blocks with takeMVar.

ruuda commented

Here’s a good overview of how to write data to disk in a way that ensures consistency: https://danluu.com/file-consistency/.

rkrzr commented

We now support requests with a strong(er) durability guarantee. This was added in #27.