[Sugar-devel] [alsroot at member.fsf.org: [PATCH] Invert index_updated logic]

Bernie Innocenti bernie at codewiz.org
Sun Jul 4 18:27:00 EDT 2010


On Sun, 2010-07-04 at 18:41 +0000, Aleksey Lim wrote:
> ----- Forwarded message from Aleksey Lim <alsroot at member.fsf.org> -----
> 
> From: Aleksey Lim <alsroot at member.fsf.org>
> Subject: [Sugar-devel] [PATCH] Invert index_updated logic
> To: sugar-devel at lists.sugarlabs.org
> Date: Sun,  4 Jul 2010 18:38:32 +0000
> 
> Assume that index_updated can be True only after index flush and before
> any index change.

Thank you very much for submitting this patch so quickly. I'll apply and
release a new sugar-datastore package so people can test on the XO-1 &
XO-1.5.

Since the change seems very invasive, for now I won't land it on the
test builds that go in the hands of children.

One observation on coding style (predating your patch): using the
index_updated property instead of explicit function calls violates the
principle of least-surprise. Simply setting index_updated to True causes
a system-wide side-effect! I think this is an evil abuse of
properties! :-)

Also, I have one question on the strategy used by your patch: do we
delete/create the index_updated flag only around index changes or before
the creation of a new entry? I want to make sure there's no window of
opportunity to get invisible entries that don't show up in the journal.

(sorry if this should have been obvious by looking at the diff, I'm not
at all familiar with the datastore codebase).

-- 
   // Bernie Innocenti - http://codewiz.org/
 \X/  Sugar Labs       - http://sugarlabs.org/



More information about the Sugar-devel mailing list