[sheepdog] [PATCH] sheep: make create operations atomic

Liu Yuan namei.unix at gmail.com
Thu Sep 13 06:39:16 CEST 2012


On 09/12/2012 06:14 PM, MORITA Kazutaka wrote:
> Currently, CREATE_AND_WRITE operations are processed even if recovery
> works of their target objects are on going (commit b3442e66).  This
> causes a problem in the following situation (and it acutually happens
> with test 008):
> 
>   1. There are three nodes, A, B, and C.
>   2. CREATE_AND_WRITE operations are sent to them, and at the same
>      time, a node D is added to cluster.
>   3. The node D recovers a object from node A, but the object is just
>      being created.  The node D reads a zero filled object; it is
>      fallocated, but data is not written yet.
>   4. The CREATE_AND_WRITE operation is retried to node D, and it is
>      successfully finished.
>   5. The recovery process on node D overwrite the object with the zero
>      filled data.
> 
> Instead of adding another complex check in request_in_recovery, this
> patch makes all CREATE_AND_WRITE operations atomic to keep code
> simplicity.  With this patch, store->write is splited into
> store->write and store->create_and_write, and store->atomic_put is
> removed.

Applied, thanks.

Yuan



More information about the sheepdog mailing list