You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by kf...@collab.net on 2003/08/24 06:14:44 UTC

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

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