[sheepdog] [PATCH 9/9] sheep: show error message when object may be lost

Liu Yuan namei.unix at gmail.com
Tue May 7 09:13:12 CEST 2013


On 05/07/2013 02:53 PM, MORITA Kazutaka wrote:
> Here is a simple scenario where sheep can show the old data:
> 
> ==
> Epoch  Nodes
> 1      [A, B, C]           <- A, B, and C has the object X
> 2      [A, B, C, D]
> 3      [A, B, C, D, E]
> 4      [A, B, C, D, E, F]  <- The object X are copied to D, E, and F, and
>                               it is updated from X to X' at this epoch
> 5      [A, B, C, D, E]
> 6      [A, B, C, D]
> 7      [A, B, C]           <- D, E, and F have gone away at the same time at epoch 4.
>                               A, B, and C still have X and recover the object
>                               to the working direcotry, but clients must see X'.
> ==
> 
> Currently, sheep rollbacks to the older epoch without considering the
> consistency problem, so it can show the older data to clients.
> 
> In the initial sheepdog codes, we returned SD_RES_EIO to clients when
> we cannot guarantee that the object is the latest one.  I'm not sure
> which is the better approach now because the above example is unlikely
> to happen and returning EIO can also stop VMs.  To make sheepdog
> tolerant against rapid node changes, I have come to think that we
> should accept the consistency problem and print the error message
> instead.
> 		      

Print the error message makes sense. But I don't understand the code yet.

+		case SD_RES_NO_OBJ:
+			/*
+			 * No object means that there was no write success at
+			 * this epoch.
+			 */
+			data_lost = false;
+			/* fall through */

So if A, B, C all return SD_RES_NO_OBJ, you set data_lost = false, in
this case, we don't print an error, no?

Thanks,
Yuan



More information about the sheepdog mailing list