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

Re: svn commit: r11750 - branches/locking/subversion/include

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2004-11-05 19:00:52 CET

Ben Collins-Sussman <sussman@collab.net> writes:

> Take the function svn_fs_apply_txdelta(), used to change a file's
> contents.
>
> Some server process authenticates a username. Now the process wants
> to change a file's contents, as part of an incoming request. When the
> process calls svn_fs_apply_txdelta(), the fs func needs to do three
> things, potentially:
>
> 1. check to see if there's a pre-existing lock on the file.
> if not, proceed normally.
>
> 2. if there's a lock, look at the 'owner' field in the lock. Is
> it the same as the authenticated username? If not, error out.
>
> 3. if the lock-owner and authenticated username match, we're still
> not out of the woods. The fs function still needs to see the
> lock-token from the client, and make sure it matches the lock.
> The client's lock-token could be some ancient defunct thing, who
> knows?

I assume that if a lock is unlocked during a transaction then the
transaction will fail. If so then svn_fs_apply_txdelta doesn't need
to validate locks (although it might do it to error out early). In
the end it's the function svn_fs_commit_txn that needs to check locks.
All that apply_txdelta needs to do is add to the list of locks that
commit_txn needs to verify.

If svn_fs_apply_txdelta is responsible for validating locks then I
think we need some mechanism to either prevent locks being unlocked
while they are "in use" by a transaction, or to fail a transaction
that is using a lock that has been unlocked. The latter appears to
involve svn_fs_commit_txn again.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Nov 5 19:01:21 2004

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