[sheepdog] [PATCH] recovery: fix incomplete recovery because of faulty oid scheduling

MORITA Kazutaka morita.kazutaka at gmail.com
Mon Apr 29 14:07:22 CEST 2013


At Mon, 29 Apr 2013 15:19:53 +0800,
Liu Yuan wrote:
> 
> On 04/29/2013 02:59 PM, MORITA Kazutaka wrote:
> > Thanks, I understood what's going on from your log.
> > 
> > The problem is that scheduled oids can be re-scheduled again.  I think
> > the following is a better fix because it also omits redundant
> > scheduling even when auto-recovery is enabled.
> 
> Why better? If auto-recovery is enabled, we don't re-schedule on the
> same oid. At least on the first oid.

The second and later oids may be already scheduled ones.
prepare_schedule_oid() can re-schedule them and re-order rw->oids
again unnecessarily.  Anyway, that's not a big problem.

Now, the current version looks okay to me, but I think the following
one does the same thing and looks simpler.

---- >8 ---- >8 ---- >8 ----
diff --git a/sheep/recovery.c b/sheep/recovery.c
index 23babe0..d2790da 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -241,7 +241,7 @@ static inline void prepare_schedule_oid(uint64_t oid)
 	 * When auto recovery is enabled, the oid is currently being
 	 * recovered
 	 */
-	if (!sys->disable_recovery && rw->oids[rw->done] == oid)
+	if (!rw->suspended && rw->oids[rw->done] == oid)
 		return;
 	rw->nr_prio_oids++;
 	rw->prio_oids = xrealloc(rw->prio_oids,



More information about the sheepdog mailing list