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

Re: How are (atomic) commits implemented?

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2005-07-18 14:46:52 CEST

On Jul 18, 2005, at 5:51 AM, KRONSTORFER Horst wrote:

> hi,
>
> let say if two users try to commit to a repository at about the
> same time,
> does the user, who is 2nd to commit, has to wait until the user who
> is 1st
> finished her commit operation completely, or is the implementation
> more
> sophisticated?

More sophisticated.

1. Revision trees are immutable, so readers never block other readers/
writers, nor are they ever blocked by other readers/writers. (A big
win over CVS!)

2. N different users can be 'writing' to separate transactions at
once. The only time anyone ever has to wait is the microsecond where
somebody's transaction is "promoted" to become the new HEAD
revision; that action needs to be serialized. (In the case of BDB,
it's a single row insert. In the case of FSFS, it's an file move.)
But given that 99% of the time it takes to commit involves just
*building* the transaction, it means that writers almost never, ever,
ever block each other. It only happens if two people finish building
their transaction and try to become HEAD at the exact same instant.
(One of them wins, the other retries a second later.)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jul 18 14:47:41 2005

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