Zaqar/specs/storage/mongodb

MongoDB Storage Driver - Marconi
Implementation notes regarding Marconi's official MongoDB storage driver.

Sequence A

 * 1) . Message 1 (M1) has a claim on it that has expired, and is returned by active.
 * 2) . claim attempts to update([M1]) and succeeds because, although "c" exists, it has expired.

Sequence B

 * 1) . Message 1 (M1) has a claim on it that has expired, and is returned by active.
 * 2) . Another request comes in and also gets [M1] from active
 * 3) . One of the requests "wins" and executes update([M1]) first, succeeding because, although "c" exists, it has expired.
 * 4) . The remaining request executes update([M1]) but M1 now exists and IS NOT expired, so updated < limit, which is acceptable.

Sequence C

 * 1) . Message 1 (M1) has no claim associated with it, and is returned by active.
 * 2) . claim attempts to update([M1]) and succeeds because "c" does not exist

Sequence D

 * 1) . Message 1 (M1) has no claim associated with it, and is returned by active.
 * 2) . Another request comes in and also gets [M1] from active
 * 3) . One of the requests "wins" and executes update([M1]) first, succeeding because "c" does not exist
 * 4) . The remaining request executes update([M1]) but M1 now exists and IS NOT expired, so updated < limit, which is acceptable.

Sequence E

 * 1) . Message 1 (M1) has no claim associated with it, and is returned by active.
 * 2) . Another request comes in and also gets [M1] from active
 * 3) . One of the requests "wins" and executes update([M1]) first, succeeding because "c" does not exist
 * 4) . The new "c" expires (winning client takes too long to process M1 or crashes)
 * 5) . Client attempts to delete M1 using "c" but get's an error because "c" has expired, so client rolls back the work it did for M1
 * 6) . The remaining request executes update([M1]) but M1 now exists and is expired, so that request gets the claim on M1