Details
-
Bug
-
Resolution: Won't Do
-
Major
-
master
-
Untriaged
-
Unknown
Description
Summary
With the OoO prototype we have a clear ownership of cookies to commands, and each cookie maintains the connection it is using. The lifetime of the cookie is well defined. Currently on the OoO prototype this state machinery is only used for connections where OoO is enabled, but in theory could be used in all cases.
However DCP provides an additional complication given that we want to map cookies 1:1 to commands. DCP needs to operate on connection ids and not cookies. This means when the engine returns ewouldblock it would stick it in the cookie.
In addition would mean that the DCP connection could process an incoming mutation (and block for lets say disk IO) and at the same time be able to send off other traffic generated by the step() method.
The motivation for this change is not performance, but more simplification of the core being able to maintain a single version of state-machinary.
Details
We need to map the cookie to a "connection identifier", and use a different "notify_io_complete" which takes the connection identifier when it wants the step method to be called.
For example in dcpAddStream instead of using the cookie we need to use a connectionID
And when we notify we need to use the connectionID as opposed to the cookie.
i.e. in notifyPausedConnection