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

Re: Exclusive Locking: design in a nutshell

From: Florian Weimer <fw_at_deneb.enyo.de>
Date: 2004-05-20 01:23:13 CEST

* Branko Čibej:

>> When somebody tries to read from the HEAD revision,
>> the system treats locked paths specially: instead of pulling the
>> file's data out of the HEAD revision, it gets pulled out of the
>> appropriate lock-txn.
>>
>>
> Nope.
>
> When anyone except the lock owner tries to read from the HEAD
> revision, everything is normal. When the lock owner tries to read
> from the HEAD revision, the system treats locked paths specially: ...
>
> The point here is that a lock on a file (or directory, don't forget
> about depth-infinity directory locks) creates a transaction. The
> isolation principle says that the results of activities that happen in
> the context of a transaction are not visible outside this context
> until the transaction is committed. In other words, only the lock
> owner can see uncommitted changes to the locked file.

By default, yes. Dirty reads on HEAD are too surprising, IMHO.

But I think it should be possible to view the pending commit, as
stored in the repository. This enables some nifty applications (for
example, you could render a document on the server and have the
creator review it, before it is actually committed). It's not clear
that it's worth the additional complexity, though.

>> * The lock-owner ultimately ends up "unlocking" the file, which
>> causes the lock-txn to be committed. Either that, or the lock
>> owner destroys the lock, which aborts the lock-txn, and all
>> changes are lost.
>>
>>
> Ah...point of terminology here: "unlock" means "release the lock,
> discarding changes"; "commit" means "release the lock, keeping
> changes". It's much more obvious that way, and you don't have a third
> destroy-lock function.

If there's "commit", there also should be "abort" or "roll back".

It seems I should read something on MVCC at this point...

-- 
Current mail filters: many dial-up/DSL/cable modem hosts, and the
following domains: bigpond.com, di-ve.com, hotmail.com, jumpy.it,
libero.it, netscape.net, postino.it, simplesnet.pt, spymac.com,
tatanova.com, tiscali.co.uk, tiscali.cz, tiscali.it, voila.fr, yahoo.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu May 20 01:23:34 2004

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.