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

Re: svn commit: rev 6837 - trunk/subversion/libsvn_repos

From: <kfogel_at_collab.net>
Date: 2003-08-24 08:14:44 CEST

mbk@tigris.org writes:
> Log:
> Obtain a shared lock on the repository *before* opening it, rather than
> *afterwards*. This should prevent a potential race-condition that may
> or may not have been the root cause of some repository corruptions.
>
> * subversion/libsvn_repos/repos.c
> (get_repos): move call to svn_fs_open_berkeley to after lock acquisition.

Hmmm. I think I want to try BDB 4.1.x again with this committed... :-)

-K

> Modified: trunk/subversion/libsvn_repos/repos.c
> ==============================================================================
> --- trunk/subversion/libsvn_repos/repos.c (original)
> +++ trunk/subversion/libsvn_repos/repos.c Fri Aug 22 17:37:07 2003
> @@ -1108,9 +1108,6 @@
> /* Initialize the filesystem object. */
> repos->fs = svn_fs_new (NULL, pool);
>
> - /* Open up the Berkeley filesystem. */
> - if (open_fs)
> - SVN_ERR (svn_fs_open_berkeley (repos->fs, repos->db_path));
>
> /* Locking. */
> {
> @@ -1147,6 +1144,10 @@
> apr_pool_cleanup_register (pool, lockfile_handle, clear_and_close,
> apr_pool_cleanup_null);
> }
> +
> + /* Open up the Berkeley filesystem only after obtaining the lock. */
> + if (open_fs)
> + SVN_ERR (svn_fs_open_berkeley (repos->fs, repos->db_path));
>
> *repos_p = repos;
> return SVN_NO_ERROR;
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Aug 24 08:57:36 2003

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.