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

Re: Making fsfs generate unique transaction names

From: Malcolm Rowe <malcolm-svn-dev_at_farside.org.uk>
Date: 2007-06-22 01:29:53 CEST

On Thu, Jun 21, 2007 at 06:14:46PM -0500, Peter Samuelson wrote:
> [Blair Zajac]
> > So I'm thinking of having two new files:
> >
> > 1) transaction-current: holds the base-36 number
> > 2) transaction-current-lock: holds the lock for incrementing
> > transaction-current.
> I don't understand why those have to be two separate files.
> We don't actually use file _existence_ as a locking mechanism, do we?

No (and that wouldn't work on NFS). We use two files elsewhere so that
we can do lockless reads: so that we can read a write-locked file
without opening the corresponding write-lock file (POSIX locks being
insane about releasing locks on file-close make the obvious single-file
solution impossible in a multi-threaded environment).

But in this case the lock is short-lived and we also need to block
readers (readers who are initialising transactions, that is). We can
therefore use a single file and lock the contents exclusively.


  • application/pgp-signature attachment: stored
Received on Fri Jun 22 02:19:16 2007

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.