[sheepdog] [PATCH] recovery: use passed epoch in fetch_object_list()

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Wed May 29 11:10:16 CEST 2013


At Wed, 29 May 2013 16:38:26 +0800,
Liu Yuan wrote:
> 
> On 05/29/2013 04:36 PM, MORITA Kazutaka wrote:
> > At Tue, 28 May 2013 14:24:08 +0800,
> > Liu Yuan wrote:
> >>
> >> Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> >> ---
> >>  sheep/recovery.c |    2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/sheep/recovery.c b/sheep/recovery.c
> >> index 2bd3a46..dba89fb 100644
> >> --- a/sheep/recovery.c
> >> +++ b/sheep/recovery.c
> >> @@ -672,7 +672,7 @@ static uint64_t *fetch_object_list(struct sd_node *e, uint32_t epoch,
> >>  retry:
> >>  	sd_init_req(&hdr, SD_OP_GET_OBJ_LIST);
> >>  	hdr.data_length = buf_size;
> >> -	hdr.epoch = sys_epoch();
> >> +	hdr.epoch = epoch;
> >>  	ret = sheep_exec_req(&e->nid, &hdr, buf);
> >>  
> >>  	switch (ret) {
> > 
> > I think the epoch field is not used for non-peer requests.  Removing
> > the line looks better to me.
> > 
> 
> This assignment just enable sheep_exec_req() retry if network is busy.

Ah, I see.  Then the intention of this change (use epoch instead of
sys->epoch) is to avoid retrying when epoch is incremented after this
recovery starts?  I think some explanation should have been included
in the commit log.

Anyway, applied this patch, thanks!

Kazutaka



More information about the sheepdog mailing list