Re: Making fsfs generate unique transaction names
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.
Received on Fri Jun 22 02:19:16 2007
- application/pgp-signature attachment: stored
This is an archived mail posted to the Subversion Dev