[Sugar-devel] [PATCH 3/7] metadatastore: store/change files on disk defensively #2317

Martin Langhoff martin at laptop.org
Mon Oct 1 12:36:16 EDT 2012


On Sun, Sep 30, 2012 at 2:10 PM, Manuel Kaufmann <humitos at gmail.com> wrote:
> The only thing that I do not understand well is this comment /
> section. Can you explain to me this a bit more? Thanks

What is unclear? The only thing I could add is a pre-amble:

Previous code deleted all metadata entries for a given DS entry and
then recreated them, on every call to update(). This caused immediate
loss of metadata in the case of ENOSPC or any other I/O problem.

With this patch:

 - only delete metadata files for keys that are being removed

 - only write files when the data changes

 - write/replace metadata files atomically, to avoid corrupting
   existing data in case of an error

With this patch, we no longer corrupt metadata when trying
to edit/update a ds entry with the system hitting ENOSPC.

Signed-off-by: Martin Langhoff <martin at laptop.org>


 --

now, if you read carefully, it is the same thing I say in the last paragraph :-)



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