[Sugar-devel] [PATCH] Invert index_updated logic

Aleksey Lim alsroot at member.fsf.org
Mon Jul 5 00:21:48 EDT 2010


On Sun, Jul 04, 2010 at 06:27:00PM -0400, Bernie Innocenti wrote:
> 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! :-)

Think so, just tried to minimize patch w/o changing existed logic.
In new patch creating flag is private function in index class.

> 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.

Any ds change should update index (call IndexStore.store/delete) thus we
all time have an access point to all ds updates.

-- 
Aleksey


More information about the Sugar-devel mailing list