In crimson, exactly like in the classical OSD, a client request has data and
ordering dependencies which must be satisfied before processing (actually
a particular phase of) can begin. As one of the goals behind crimson is to
preserve the compatibility with the existing OSD incarnation, the same semantic
must be assured. An obvious example of such data dependency is the fact that
an OSD needs to have a version of OSDMap that matches the one used by the client
If a dependency is not satisfied, the processing stops. It is crucial to note the same must happen to all other requests that are sequenced-after (due to their ordering requirements).
There are a few cases when the blocking of a client request can happen.
wait for particular OSDMap version is available at the OSD level
wait a particular PG becomes available on OSD
wait on a PG being advanced to particular epoch
wait for a PG to become active (i.e. have
wait on an object to be recovered (i.e. leaving the
wait on an object to be available for locking. The
obcwill be locked before this operation is allowed to continue
wait if any other
MOSDOpmessage is handled against this PG
At any moment, a
ClientRequest being served should be in one and only one
of the phases described above. Similarly, an object denoting particular phase
can host not more than a single
ClientRequest the same time. At low-level
this is achieved with a combination of a barrier and an exclusive lock.
They implement the semantic of a semaphore with a single slot for these exclusive
As the execution advances, request enters next phase and leaves the current one
freeing it for another
ClientRequest instance. All these phases form a pipeline
which assures the order is preserved.
These pipeline phases are divided into two ordering domains:
PGPipeline. The former ensures order across a client connection while
the latter does that across a PG. That is, requests originating from the same
connection are executed in the same order as they were sent by the client.
The same applies to the PG domain: when requests from multiple connections reach
a PG, they are executed in the same order as they entered a first blocking phase
Comparison with the classical OSD
As the audience of this document are Ceph Developers, it seems reasonable to
match the phases of crimson’s
ClientRequest pipeline with the blocking
stages in the classical OSD. The names in the right column are names of
containers (lists and maps) used to implement these stages. They are also
already documented in the
ceph-osd waiting list
To be done (
To be done
To be done (proxying)
As the last word it might be worth to emphasize that the ordering implementations in both classical OSD and in crimson are stricter than a theoretical minimum one required by the RADOS protocol. For instance, we could parallelize read operations targeting the same object at the price of extra complexity but we don’t -- the simplicity has won.