<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16722">
<STYLE>@font-face {
        font-family: 宋体;
}
@font-face {
        font-family: Verdana;
}
@font-face {
        font-family: @宋体;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; layout-grid: 15.6pt; }
P.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; FONT-SIZE: 10.5pt
}
LI.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; FONT-SIZE: 10.5pt
}
DIV.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; FONT-SIZE: 10.5pt
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        FONT-STYLE: normal; FONT-FAMILY: Verdana; COLOR: windowtext; FONT-WEIGHT: normal; TEXT-DECORATION: none; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
UNKNOWN {
        FONT-SIZE: 10pt
}
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</STYLE>
</HEAD>
<BODY style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt">
<DIV><FONT size=2 face=Verdana>Thanks for your replies!</FONT></DIV>
<DIV>Another questions:</DIV>
<DIV>1. write_object() return's value always >= 0</DIV>
<DIV>   but when you call the write_object, you think an error 
happened if ret < 0</DIV>
<DIV>   for example in vdi.c<FONT color=#000080><FONT 
color=#000000>  </FONT></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr>
  <DIV><FONT color=#ff0000>if (ret < 0)</FONT></DIV>
  <DIV><FONT color=#ff0000>return SD_RES_VDI_WRITE;</FONT></DIV></BLOCKQUOTE>
<DIV dir=ltr><FONT color=#000000>   </FONT></DIV>
<DIV dir=ltr><FONT color=#000000>I think this is bug ,because return values is 
impossible < 0, and can't get error of the write_object.</FONT></DIV></FONT>
<DIV><FONT color=#000080 size=2 face=Verdana></FONT> </DIV>
<DIV><FONT size=2 face=Verdana>Thanks </FONT></DIV>
<DIV>yaronli</DIV>
<DIV><FONT color=#c0c0c0 size=2 face=Verdana>2011-03-16 </FONT></DIV><FONT 
color=#000080 size=2 face=Verdana>
<HR style="WIDTH: 100px" align=left color=#b5c4df SIZE=1>
</FONT>
<DIV><FONT color=#c0c0c0 size=2 face=Verdana><SPAN>jidalyg_8711</SPAN> 
</FONT></DIV>
<HR color=#b5c4df SIZE=1>

<DIV><FONT size=2 face=Verdana><STRONG>发件人:</STRONG> MORITA Kazutaka 
</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>发送时间:</STRONG> 2011-03-15  18:14:21 
</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>收件人:</STRONG> jidalyg_8711 </FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>抄送:</STRONG> sheepdog </FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>主题:</STRONG> Re: [Sheepdog] sheepdog's 
recovery alogorithm questions </FONT></DIV>
<DIV><FONT size=2 face=Verdana></FONT> </DIV>
<DIV><FONT size=2 face=Verdana>
<DIV>Hi,</DIV>
<DIV></DIV>
<DIV>On Tue, Mar 15, 2011 at 12:09 PM, jidalyg_8711 <jidalyg_8711@163.com> wrote:</DIV>
<DIV>> 1. sheepdog claim it is strong consistent, And I think the implemention of</DIV>
<DIV>> the read_object() write_object() remove_object()  ensure that strong</DIV>
<DIV>> consistent?  any other places to ensure it ?   How about it affect the</DIV>
<DIV>> performance of the sheepdog?</DIV>
<DIV></DIV>
<DIV>The mechanism to ensure data consistency are:</DIV>
<DIV></DIV>
<DIV>- Sheepdog stores objects in the epoch number directory, and doesn't</DIV>
<DIV>  allow clients to read objects from old epoch number directories.</DIV>
<DIV>  This prevents clients from reading old data which are not</DIV>
<DIV>  up-to-date.</DIV>
<DIV></DIV>
<DIV>- Sheepdog allows write requests from at most one client.</DIV>
<DIV>  Administrators need to pay attention for this when using Sheepdog.</DIV>
<DIV>  This avoids write conflicts and ensures object consistency easily.</DIV>
<DIV></DIV>
<DIV>></DIV>
<DIV>> 2. About the recovery alogorithm, When the new node join  or the node</DIV>
<DIV>> left,  sheepdog will call start_recovery()func and recovery in background.</DIV>
<DIV>> The main actions of the recovery is move the object to the new node and the</DIV>
<DIV>> epoch directory ; while recoverying, the READ_OBJECT request arrived,</DIV>
<DIV>> currently sys->epoch has increased, but the object maybe still in old epoch</DIV>
<DIV>> directory ,not yet move to the new epoch, How the sheepdog handle the</DIV>
<DIV>> situation ?  And the sys->epoch increased in update_cluster_status()</DIV>
<DIV>> before calling start_recovery()</DIV>
<DIV></DIV>
<DIV>Before processing the object request, Sheepdog checks whether the</DIV>
<DIV>requesting object is recovered to the current epoch directory or not</DIV>
<DIV>in is_recoverying_oid().  If the object is not recovered yet, Sheepdog</DIV>
<DIV>recovers the object first, and after that, processes the request.</DIV>
<DIV></DIV>
<DIV>Thanks,</DIV>
<DIV></DIV>
<DIV>Kazutaka</DIV></FONT></DIV></BODY></HTML>