[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Ref-counting for pristine texts

From: Bert Huijben <bert_at_qqmail.nl>
Date: Thu, 27 Jan 2011 19:46:17 +0100

> -----Original Message-----
> From: Julian Foad [mailto:julian.foad_at_wandisco.com]
> Sent: donderdag 27 januari 2011 18:06
> To: Bert Huijben
> Cc: 'Branko Čibej'; dev_at_subversion.apache.org
> Subject: RE: Ref-counting for pristine texts
>
> On Wed, 2011-01-26, Bert Huijben wrote:
> > > -----Original Message-----
> > > From: Julian Foad [mailto:julian.foad_at_wandisco.com]
> > >
> > > Can anyone help me work out the rules for guaranteeing consistency
> of
> > > the pristine text store?
> >
> > Previously we used a somewhat reversed definition: as long as there
> > are work queue items or working-copy locks, you can't assume
> pristines
> > are unreferenced.
>
> Ah, WC-locks. Yes, that sounds more likely. (I don't recall that we
> have ever used that rule yet. The pristine cleanup code has only ever
> checked "WQ is empty", which isn't good enough.)
>
> > Note that there can be multiple clients accessing/modifying a working
> > copy at the same time even though they don't have a sqlite
> transaction
> > open. (An update doesn’t keep it's transaction open for the entire
> > update process).
>
> Yes. Nor does the update process keep work items items in the WQ
> during
> the whole time - it runs the WQ at various points. But there is a WC
> lock through the whole update process.
>
> So we can write a rule:
>
> "You may purge unreferenced pristines only when
> there are no WC locks in the DB."
>
> More precisely, the access control rules for the pristine store in a
> given WC shall be:
>
> * A process may add a new (initially unreferenced) pristine text
> to the store
> IFF this process has a WC lock.
>
> * A process may add or remove references to any pristine text that
> is in the store
> IFF this process has a WC lock.

Maybe this one can be loosened a bit; not sure though... (incrementing or decrementing a reference is probably safe when the other rules are followed)

>
> * A process that has a WC lock may assume that no pristine text,
> even if unreferenced, will be deleted from the store as long as
> this process holds any WC lock in this WC.
>
> * A process may purge an unreferenced pristine text
> IFF no other process has a WC lock.
> ### Must this process have a WC lock?
>
> (I use the word "process" loosely.)
>
> Does that make sense?

I think it does.

        Bert
>
> - Julian
>
Received on 2011-01-27 19:46:51 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.