[sheepdog] [PATCH RFC 1/2] sheep: enhance STAT_RECOVERY for prividing information of recovery progress

Hitoshi Mitake mitake.hitoshi at gmail.com
Thu Aug 1 03:19:09 CEST 2013


At Mon, 29 Jul 2013 16:02:30 +0800,
Liu Yuan wrote:
> 
> On Mon, Jul 29, 2013 at 04:39:26PM +0900, Hitoshi Mitake wrote:
> > Current SD_OP_STAT_RECOVERY only provides an information that
> > indicates the node is doing recovery or not. For providing more useful
> > information about progress of recovery, this patch enhances this
> > request.
> > 
> > The enhanced SD_OP_STAT_RECOVERY returns the information with struct
> > recovery_progress. The struct contains these information:
> > 1. state of recovery. With this information, collie can know which
> >    phase of progress sheep is in.
> > 2. Number of copied object during a recovery process.
> > 3. Number of entire objects which should be copied during a recovery
> >    process.
> > 
> > Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
> > ---
> >  include/internal_proto.h |   12 ++++++++++++
> >  sheep/ops.c              |   11 ++++++++---
> >  sheep/recovery.c         |   33 ++++++++++++++++++++++++---------
> >  sheep/sheep_priv.h       |    1 +
> >  4 files changed, 45 insertions(+), 12 deletions(-)
> > 
> > diff --git a/include/internal_proto.h b/include/internal_proto.h
> > index 0463eae..6d7a0e9 100644
> > --- a/include/internal_proto.h
> > +++ b/include/internal_proto.h
> > @@ -184,6 +184,18 @@ struct sd_md_info {
> >  	int nr;
> >  };
> >  
> > +enum rw_state {
> > +	RW_PREPARE_LIST, /* the recovery thread is preparing object list */
> > +	RW_RECOVER_OBJ, /* the thread is recoering objects */
> > +	RW_NOTIFY_COMPLETION, /* the thread is notifying recovery completion */
> > +};
> > +
> > +struct recovery_progress {
> > +	uint32_t state;		/* actual type is enum rw_state */
> 
> enum rw_state state; then you don't need comment.
> 
> > +	uint32_t nr_recovered_objects;
> > +	uint32_t nr_entire_checked_objects;
> > +};
> 
> it's recovery information, so better name it as recovery_info. And

recovery_info is already used. I'll keep the name as recovery_progress.

> 
> nr_recovered_objects --> finished_count
> nr_entire_checked_objects --> total

How about nr_finished and nr_total?

Thanks,
Hitoshi



More information about the sheepdog mailing list