[Sugar-devel] [PATCH 0/7] datastore: handle ENOSPC gracefully

Martin Langhoff martin at laptop.org
Thu Sep 20 23:55:33 EDT 2012


In conditions of very low disk space available, or ENOSPC, the datastore
misbehaves grossly:

 - sometimes corrupts the index, and won't rebuild it, "hiding" valid
   entries from the user
 - if you edit an entry metadata, it will corrupt the whole entry
 - attempts at deleting entries fail, so users cannot get out of ENOSPC

This patchseries is an attempt at fixing these issues. The overall user
experience is not perfect when we hit ENOSPC -- metadata edits are ignored,
sometimes the datastore process goes away (so the Journal is not responsive
until a new datastore process is spawned and ready).

However, it behaves sanely:

 - testing this code I do not lose ds entries when editing them
 - I can remove entries correctly, even at ENOSPC, effectively freeing disk
   space
 - the index works even at ENOSPC, though it may take slower for the
   system to start in those cases where we do rebuild it
 - the index recovers gracefully on restart when there is free disk space

Martin Langhoff (7):
  Add ds_clean flag to trigger index rebuilds #2095, #2317
  Remove invalid/corrupt on-disk entries #2317
  metadatastore: store/change files on disk defensively #2317
  metadatareader: ignore ".hidden" files
  indexstore: exit on _flush() errors, work on tmpdir
  datastore: make delete() more reliable, log properly
  datastore: handle low-disk and ENOSPC conditions gracefully

 src/carquinyol/datastore.py     |  142 +++++++++++++++++++++++++++++++++------
 src/carquinyol/indexstore.py    |   52 ++++++++++----
 src/carquinyol/metadatareader.c |    7 +-
 src/carquinyol/metadatastore.py |   51 +++++++++-----
 4 files changed, 197 insertions(+), 55 deletions(-)

-- 
1.7.10.4



More information about the Sugar-devel mailing list