You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Seumas Soltysik <ss...@aurea.com> on 2013/09/19 18:18:04 UTC

svnsync --disable-locking

I am using svnsync to sync a mirror with a master. However, I am getting
the following error:
svnsync: E160039: User 'xxxx' does not own lock on path '/foo/bar'

I understand why this is happening but I am not sure what the solution is.

Based upon the svnsync documentation it would appear that the "svnsync
--disable-locking" option is what I need. However, in my opinion the
documentation is unclear about what the option does and googling returns
very little that is helpful.
Am I correct in believing that the --disable-locking mechanism will ignore
all user locks on the mirror and allow me to sync the master and mirror and
thus resolve the error that I am seeing?
Regards,
Seumas Soltysik

Re: svnsync --disable-locking

Posted by Philip Martin <ph...@wandisco.com>.
Seumas Soltysik <ss...@aurea.com> writes:

> I am still a bit confused about the difference between --steal-lock and
> --disable-locking. I understand that --steal-lock basically deletes/steals
> the lock property on revision 0 which controls who has the right to perform
> an svnsync. I use this in the event that a network issue interrupts a sync.
> Is --disable-locking basically a super-set of this? I have seen by trial
> and error that --steal-lock and --disable-locking are mutually exclusive so
> I am assuming that --disable-locking does the same thing as --steal-lock
> plus more.

svnsync locks the destination repository by setting a revision property
on r0.  This ensures that only one svnsync process runs and writes to
the repository.  If an svnsync process terminates abnormally it may
leave a 'stale' lock that prevents other svnsync processes running.

--steal-lock causes svnserve to take over the lock that was created by
some other svnserve process.  It is used when a 'stale' lock is present
and would generally only be used after manual verification that the
previous svnsync was not running.

--disable-locking causes svnserve to ignore any existing lock and also
to not set a lock.  It is generally only used when some external
locking, such as the lockfile(1) command, controls when svnsync is run.
One reason to use external locking is that before Subversion 1.7 the
revision property was not properly atomic and so the lock could not
guarantee exclusion for processes started in quick succession.

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*

Re: svnsync --disable-locking

Posted by Seumas Soltysik <ss...@aurea.com>.
Phillip,
Thanks for the reply. I was hoping it would allow me to sync without regard
file locks. In the end I just used rmlocks to remove the lock and then
re-ran svnsync.

I am still a bit confused about the difference between --steal-lock and
--disable-locking. I understand that --steal-lock basically deletes/steals
the lock property on revision 0 which controls who has the right to perform
an svnsync. I use this in the event that a network issue interrupts a sync.
Is --disable-locking basically a super-set of this? I have seen by trial
and error that --steal-lock and --disable-locking are mutually exclusive so
I am assuming that --disable-locking does the same thing as --steal-lock
plus more.

At this point I have chosen to disable locking through a pre-lock hook on
the master as it seems like the hassle of dealing with lock propagation to
the mirror is not worth the benefits of locking. We will see what
developers think about this!

Regards,
Seumas


On Thu, Sep 19, 2013 at 2:41 PM, Philip Martin
<ph...@wandisco.com>wrote:

> Seumas Soltysik <ss...@aurea.com> writes:
>
> > I am using svnsync to sync a mirror with a master. However, I am getting
> > the following error:
> > svnsync: E160039: User 'xxxx' does not own lock on path '/foo/bar'
> >
> > I understand why this is happening but I am not sure what the solution
> is.
> >
> > Based upon the svnsync documentation it would appear that the "svnsync
> > --disable-locking" option is what I need. However, in my opinion the
> > documentation is unclear about what the option does and googling returns
> > very little that is helpful.
> > Am I correct in believing that the --disable-locking mechanism will
> ignore
> > all user locks on the mirror and allow me to sync the master and mirror
> and
> > thus resolve the error that I am seeing?
>
> No.  svnsync uses revision properties to 'lock' the mirror repository to
> ensure that only one svnsync process modifies the mirror at any one
> time.  --disable-locking disables that locking.
>
> svnsync doesn't support Subversion's exclusive file locking.  You need
> to remove the locks from the mirror.  You can use svnadmin's lslocks and
> rmlocks or, for an FSFS repository, you could remove the db/locks dir.
> You might install a pre-lock hook in the mirror to prevent locks being
> taken.
>
> --
> Philip Martin | Subversion Committer
> WANdisco // *Non-Stop Data*
>

Re: svnsync --disable-locking

Posted by Philip Martin <ph...@wandisco.com>.
Seumas Soltysik <ss...@aurea.com> writes:

> I am using svnsync to sync a mirror with a master. However, I am getting
> the following error:
> svnsync: E160039: User 'xxxx' does not own lock on path '/foo/bar'
>
> I understand why this is happening but I am not sure what the solution is.
>
> Based upon the svnsync documentation it would appear that the "svnsync
> --disable-locking" option is what I need. However, in my opinion the
> documentation is unclear about what the option does and googling returns
> very little that is helpful.
> Am I correct in believing that the --disable-locking mechanism will ignore
> all user locks on the mirror and allow me to sync the master and mirror and
> thus resolve the error that I am seeing?

No.  svnsync uses revision properties to 'lock' the mirror repository to
ensure that only one svnsync process modifies the mirror at any one
time.  --disable-locking disables that locking.

svnsync doesn't support Subversion's exclusive file locking.  You need
to remove the locks from the mirror.  You can use svnadmin's lslocks and
rmlocks or, for an FSFS repository, you could remove the db/locks dir.
You might install a pre-lock hook in the mirror to prevent locks being
taken.

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*