[sheepdog] [PATCH v2 3/4] sheep: add support for manual recovery

Liu Yuan namei.unix at gmail.com
Wed Sep 12 10:21:13 CEST 2012


On 09/12/2012 03:05 PM, MORITA Kazutaka wrote:
>  }
>  
> +/*
> + * When automatic object recovery is disabled, the behavior of the
> + * recovery process is like 'lazy recovery'.  This function returns
> + * true if the recovery queue contains objects being accessed by
> + * clients.  Sheep recovers such objects for availability even when
> + * automatic object recovery is not enabled.
> + */
> +static bool has_scheduled_objects(struct recovery_work *rw)
> +{
> +	return rw->nr_scheduled_prio_oids <= rw->done;
> +}
> +

Well, if this function returns true when we have objects scheduled, then
below if conditions should be:

if (sys->disable_recovery && !has_scheduled_objects(rw))

no?

Thanks,
Yuan

> +static void recover_next_object(struct recovery_work *rw)
> +{
> +	if (next_rw) {
> +		run_next_rw(rw);
> +		return;
> +	}
> +
> +	if (rw->nr_prio_oids)
> +		finish_schedule_oids(rw);
> +
> +	if (sys->disable_recovery && has_scheduled_objects(rw)) {
> +		dprintf("suspended\n");
> +		rw->suspended = true;
> +		/* suspend until resume_suspended_recovery() is called */
> +		return;
> +	}




More information about the sheepdog mailing list