[Sugar-devel] [PATCH 1/7] Add ds_clean flag to trigger index rebuilds #2095, #2317

Martin Langhoff martin at laptop.org
Mon Oct 1 10:44:05 EDT 2012


On Sun, Sep 30, 2012 at 12:24 PM, Manuel Kaufmann <humitos at gmail.com> wrote:
> On Fri, Sep 21, 2012 at 12:55 AM, Martin Langhoff <martin at laptop.org> wrote:
>> This gives us more complete coverage of cases where ENOSPC or
>> other errors are hit when creating/updating datastore entries.
>
> I reviewed this patch and I think it's OK. I didn't test it because
> I'm not sure how to simulate that scenario.

Repro procedures are explained in my '0/5' cover letter. Use and abuse
dd for your evil purposes.

> Just a comment: why you didn't add a callback function
> (_delete_completion_cb) to the "delete" method and make create /
> update / delete consistent between them? In that method we can add
> self._mark_clean

My understanding is that delete does not get structured as a
trigger/callback because delete is supposed to be quick.

> Thought: we are dealing near ENOSPC, right? So, maybe the clean_flag
> will not be created (this is already handled in the patch) and this
> patch will not take effect the next time the XO restarts and we will
> be in the same situation again.

That is by design! We can only save our clean flags, both for ds and
index, if we have disk space. Our state is "dirty" when they are
missing, and they may very well be missing because we could not write
them to disk!

Think about it this way: when we start up, we default to rebuilding
our index, assuming the ds and index may be corrupt. Only if we see
the two clean flags we skip the rebuild (which leads to a faster
startup).

hth,



m
-- 
 martin at laptop.org -- Software Architect - OLPC
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff


More information about the Sugar-devel mailing list