[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: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2005-07-18 17:34:28 CEST

On Mon, 2005-07-18 at 07:46 -0500, Ben Collins-Sussman wrote:
> 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.)

Ben makes it sound a little simpler than it is. If two people try to
commit at the same time, they both build a transaction on the server;
then, one of the commits is finalized, and the other one has to be
"auto-merged" with the first one. The auto-merge algorithm knows how to
merge together compatible directory operations, but will fail out if
both commits make changes to the same file.

Also, in FSFS the finalization of a commit is not just a file move; the
transaction has to be converted from a form with easily-mutable
directory entries to the more compact (but not easily modified) form
used in revision files. This means FSFS has a larger serialization
window than BDB, although it's still pretty quick (the slow steps of
receiving the new data from the client and computing file deltas have
already been accomplished before finalization begins).

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jul 18 17:36:29 2005

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.