On 23.06.2015 16:34, kot...@apache.org wrote:
> Author: kotkov
> Date: Tue Jun 23 14:34:05 2015
> New Revision: 1687079
>
> URL: http://svn.apache.org/r1687079
> Log:
> Only lock the hotcopy destination (by taking db/write-lock, db/pack-lock
> and db/txn-current-lock) when we are running in the incremental mode.  We
> don't have to do this in a non-incremental mode, because the destination
> is not openable until we are done with the hotcopy.  If it cannot be opened,
> concurrency is not an issue.
>
> * subversion/libsvn_fs_fs/hotcopy.c
>   (svn_fs_fs__hotcopy): Lock the hotcopy destination only if we're running
>    in incremental mode (and a fallback to the non-incremental mode didn't
>    happen).
>
> Modified:
>     subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c
>
> Modified: subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c
> URL: 
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c?rev=1687079&r1=1687078&r2=1687079&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c (original)
> +++ subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c Tue Jun 23 14:34:05 
> 2015
> @@ -1086,7 +1086,15 @@ svn_fs_fs__hotcopy(svn_fs_t *src_fs,
>    hbb.notify_baton = notify_baton;
>    hbb.cancel_func = cancel_func;
>    hbb.cancel_baton = cancel_baton;
> -  SVN_ERR(svn_fs_fs__with_all_locks(dst_fs, hotcopy_body, &hbb, pool));
> +
> +  /* Lock the destination in the incremental mode.  For a non-incremental
> +   * hotcopy, don't take any locks.  In that case the destination cannot be
> +   * opened until the hotcopy finishes, and we don't have to worry about
> +   * concurrency. */
> +  if (incremental)
> +    SVN_ERR(svn_fs_fs__with_all_locks(dst_fs, hotcopy_body, &hbb, pool));
> +  else
> +    SVN_ERR(hotcopy_body(&hbb, pool));

What happens now if you run a non-incremental an an incremental hotcopy
almost in parallel?

Even if that's not an issue, which problem does this change solve?

-- Brane

Reply via email to