You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Michalis Karatzas <mi...@gmail.com> on 2006/04/10 10:20:53 UTC

Inconsistent locks between working copy and repository

------
setup
------

I setup a svn repository accessible throw apache2 http for the
needs of a project.The project has a lot of binary files so we
end up using the Lock/Modify/Unlock mode and this lead me to
write some hook scripts to force the users to work in that mode
(e.g. All file in the repository has to have a needs-lock
property set, every change on the repository must be on files
locked by the transaction owner, etc)
All the svn clients access the repository throw http and apache2


------------
The problem:
------------


A repository user locks a file ( fileA ) and  moves to fileB:
       >svn lock fileA
       >svn move fileA fileB


So far all is ok.


When the user commits the changes and the pre-commit fails, so
the transaction fails, the locks between the working copy and
the repository are inconsistent. ( e.g. the lock on
the fileA at repository have been released ! )



My first thought has that I have some bug in the pre-commit script.
After some time messing with the script, I found that there is no
error in the pre-commit script, but for some reason, the command
"svnlook lock filaA"  informs no lock on the file.

So I replace the pre-commit code with this just the one line:
            exit 1

The same happened. If the transactiopn fails, but the lock is released.
Is something that I don't understand?
If the commit fails why lock is released?
And the worst is that before the end of the transaction
(inside pre-commit hook) the lock is already released.

Below is a unix shell script for reproduce the problem:
--script start------------------
################################################################
#    CHANGE the REPO , UTL_REPO  and WC variales
#             to meet your configuration
################################################################
#
REPO=/svn/repos/repoTest
URL_REPO=http://146.124.244.185/svn/repoTest
WC=`pwd`/wc
#

rm -rf $REPO $WC
svnadmin create $REPO

svnadmin load $REPO <<EOF
SVN-fs-dump-format-version: 2

UUID: 7dad8dd4-cd10-0410-9524-cf8073a4e8f7

Revision-number: 0
Prop-content-length: 56
Content-length: 56

K 8
svn:date
V 27
2006-04-07T02:15:27.237635Z
PROPS-END

Revision-number: 1
Prop-content-length: 128
Content-length: 128

K 7
svn:log
V 30
First Commit added file a.txt

K 10
svn:author
V 3
svn
K 8
svn:date
V 27
2006-04-07T02:20:55.871982Z
PROPS-END

Node-path: a.txt
Node-kind: file
Node-action: add
Prop-content-length: 36
Text-content-length: 25
Text-content-md5: 1555971975b5d6a8a18b74c53b67838f
Content-length: 61

K 10
needs-lock
V 5
a.txt
PROPS-END
This is the file 'a.txt'


EOF


svn co $URL_REPO $WC

cat > $REPO/hooks/pre-commit  <<EOF
echo "this is for test only" >&2
exit 1
EOF

chmod 777 $REPO/hooks/pre-commit

cd $WC
svn lock a.txt
svn move a.txt ren.txt
svn ci -m "rename file a.txt to ren.txt"

echo
echo
echo
echo Running svnlook lock a.txt
echo
svnlook lock $REPO a.txt

--script end------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Inconsistent locks between working copy and repository

Posted by Michalis Karatzas <mi...@gmail.com>.
On 4/13/06, Michalis Karatzas <mi...@gmail.com> wrote:
> On 4/13/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> > On 4/12/06, Michalis Karatzas <mi...@gmail.com> wrote:
> > > On 4/11/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> > > > On 4/10/06, Michalis Karatzas <mi...@gmail.com> wrote:
> > > > > ------
> > > > > setup
> > > > > ------
> > > > >
> > > > > I setup a svn repository accessible throw apache2 http for the
> > > > > needs of a project.The project has a lot of binary files so we
> > > > > end up using the Lock/Modify/Unlock mode and this lead me to
> > > > > write some hook scripts to force the users to work in that mode
> > > > > (e.g. All file in the repository has to have a needs-lock
> > > > > property set, every change on the repository must be on files
> > > > > locked by the transaction owner, etc)
> > > > > All the svn clients access the repository throw http and apache2
> > > > >
> > > > >
> > > > > ------------
> > > > > The problem:
> > > > > ------------
> > > > >
> > > > >
> > > > > A repository user locks a file ( fileA ) and  moves to fileB:
> > > > >        >svn lock fileA
> > > > >        >svn move fileA fileB
> > > > >
> > > > >
> > > > > So far all is ok.
> > > > >
> > > > >
> > > > > When the user commits the changes and the pre-commit fails, so
> > > > > the transaction fails, the locks between the working copy and
> > > > > the repository are inconsistent. ( e.g. the lock on
> > > > > the fileA at repository have been released ! )
> > > >
> > > > I just tried to reproduce this here, and it looks like a bug to me.
> > > > If you could file an issue that would be great.  Note that it doesn't
> > > > require apache + mod_dav_svn, you can get the same behavior with
> > > > ra_local.
> > > >
> > > > -garrett
> > > >
> > > thank you Garrett for the reply.
> > >
> > > I spend some more time on this and
> > > i wondering if there are two bugs here:
> > >
> > > 1.  Inside pre-commit script the "svnlook lock" or "svnadmin lslocks"
> > >      does not list the lock on the file.
> > >
> > > 2.  In case of using ra_dav,  after the unsuccessful commit
> > >      the lock is released form the repository.
> > >
> > > Can please anyone try to reproduce the second one, so I can be sure
> > > before I file those issues?
> >
> > If I had to guess I'd say it's probably a single root cause, so I'd
> > just file one issue and mention both points in it.
> >
> > -garrett
> >
> so far I'm sure there is bug ( i can't identify the sub-module ),
> I'll file one issue mention both points., as Garrett proposed
>
> I tried to reproduce the problem with ra_local , but I can't.
> On my server the problem occur only when using ra_dav.
>
> thank you all for your time.
> michalis
>
I just file the an issue with ID  2534

-michalis

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Inconsistent locks between working copy and repository

Posted by Michalis Karatzas <mi...@gmail.com>.
On 4/13/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> On 4/12/06, Michalis Karatzas <mi...@gmail.com> wrote:
> > On 4/11/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> > > On 4/10/06, Michalis Karatzas <mi...@gmail.com> wrote:
> > > > ------
> > > > setup
> > > > ------
> > > >
> > > > I setup a svn repository accessible throw apache2 http for the
> > > > needs of a project.The project has a lot of binary files so we
> > > > end up using the Lock/Modify/Unlock mode and this lead me to
> > > > write some hook scripts to force the users to work in that mode
> > > > (e.g. All file in the repository has to have a needs-lock
> > > > property set, every change on the repository must be on files
> > > > locked by the transaction owner, etc)
> > > > All the svn clients access the repository throw http and apache2
> > > >
> > > >
> > > > ------------
> > > > The problem:
> > > > ------------
> > > >
> > > >
> > > > A repository user locks a file ( fileA ) and  moves to fileB:
> > > >        >svn lock fileA
> > > >        >svn move fileA fileB
> > > >
> > > >
> > > > So far all is ok.
> > > >
> > > >
> > > > When the user commits the changes and the pre-commit fails, so
> > > > the transaction fails, the locks between the working copy and
> > > > the repository are inconsistent. ( e.g. the lock on
> > > > the fileA at repository have been released ! )
> > >
> > > I just tried to reproduce this here, and it looks like a bug to me.
> > > If you could file an issue that would be great.  Note that it doesn't
> > > require apache + mod_dav_svn, you can get the same behavior with
> > > ra_local.
> > >
> > > -garrett
> > >
> > thank you Garrett for the reply.
> >
> > I spend some more time on this and
> > i wondering if there are two bugs here:
> >
> > 1.  Inside pre-commit script the "svnlook lock" or "svnadmin lslocks"
> >      does not list the lock on the file.
> >
> > 2.  In case of using ra_dav,  after the unsuccessful commit
> >      the lock is released form the repository.
> >
> > Can please anyone try to reproduce the second one, so I can be sure
> > before I file those issues?
>
> If I had to guess I'd say it's probably a single root cause, so I'd
> just file one issue and mention both points in it.
>
> -garrett
>
so far I'm sure there is bug ( i can't identify the sub-module ),
I'll file one issue mention both points., as Garrett proposed

I tried to reproduce the problem with ra_local , but I can't.
On my server the problem occur only when using ra_dav.

thank you all for your time.
michalis

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Inconsistent locks between working copy and repository

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 4/12/06, Michalis Karatzas <mi...@gmail.com> wrote:
> On 4/11/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> > On 4/10/06, Michalis Karatzas <mi...@gmail.com> wrote:
> > > ------
> > > setup
> > > ------
> > >
> > > I setup a svn repository accessible throw apache2 http for the
> > > needs of a project.The project has a lot of binary files so we
> > > end up using the Lock/Modify/Unlock mode and this lead me to
> > > write some hook scripts to force the users to work in that mode
> > > (e.g. All file in the repository has to have a needs-lock
> > > property set, every change on the repository must be on files
> > > locked by the transaction owner, etc)
> > > All the svn clients access the repository throw http and apache2
> > >
> > >
> > > ------------
> > > The problem:
> > > ------------
> > >
> > >
> > > A repository user locks a file ( fileA ) and  moves to fileB:
> > >        >svn lock fileA
> > >        >svn move fileA fileB
> > >
> > >
> > > So far all is ok.
> > >
> > >
> > > When the user commits the changes and the pre-commit fails, so
> > > the transaction fails, the locks between the working copy and
> > > the repository are inconsistent. ( e.g. the lock on
> > > the fileA at repository have been released ! )
> >
> > I just tried to reproduce this here, and it looks like a bug to me.
> > If you could file an issue that would be great.  Note that it doesn't
> > require apache + mod_dav_svn, you can get the same behavior with
> > ra_local.
> >
> > -garrett
> >
> thank you Garrett for the reply.
>
> I spend some more time on this and
> i wondering if there are two bugs here:
>
> 1.  Inside pre-commit script the "svnlook lock" or "svnadmin lslocks"
>      does not list the lock on the file.
>
> 2.  In case of using ra_dav,  after the unsuccessful commit
>      the lock is released form the repository.
>
> Can please anyone try to reproduce the second one, so I can be sure
> before I file those issues?

If I had to guess I'd say it's probably a single root cause, so I'd
just file one issue and mention both points in it.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Inconsistent locks between working copy and repository

Posted by Michalis Karatzas <mi...@gmail.com>.
On 4/11/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> On 4/10/06, Michalis Karatzas <mi...@gmail.com> wrote:
> > ------
> > setup
> > ------
> >
> > I setup a svn repository accessible throw apache2 http for the
> > needs of a project.The project has a lot of binary files so we
> > end up using the Lock/Modify/Unlock mode and this lead me to
> > write some hook scripts to force the users to work in that mode
> > (e.g. All file in the repository has to have a needs-lock
> > property set, every change on the repository must be on files
> > locked by the transaction owner, etc)
> > All the svn clients access the repository throw http and apache2
> >
> >
> > ------------
> > The problem:
> > ------------
> >
> >
> > A repository user locks a file ( fileA ) and  moves to fileB:
> >        >svn lock fileA
> >        >svn move fileA fileB
> >
> >
> > So far all is ok.
> >
> >
> > When the user commits the changes and the pre-commit fails, so
> > the transaction fails, the locks between the working copy and
> > the repository are inconsistent. ( e.g. the lock on
> > the fileA at repository have been released ! )
>
> I just tried to reproduce this here, and it looks like a bug to me.
> If you could file an issue that would be great.  Note that it doesn't
> require apache + mod_dav_svn, you can get the same behavior with
> ra_local.
>
> -garrett
>
thank you Garrett for the reply.

I spend some more time on this and
i wondering if there are two bugs here:

1.  Inside pre-commit script the "svnlook lock" or "svnadmin lslocks"
     does not list the lock on the file.

2.  In case of using ra_dav,  after the unsuccessful commit
     the lock is released form the repository.

Can please anyone try to reproduce the second one, so I can be sure
before I file those issues?

Thanks a lot,
michalis

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Inconsistent locks between working copy and repository

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 4/10/06, Michalis Karatzas <mi...@gmail.com> wrote:
> ------
> setup
> ------
>
> I setup a svn repository accessible throw apache2 http for the
> needs of a project.The project has a lot of binary files so we
> end up using the Lock/Modify/Unlock mode and this lead me to
> write some hook scripts to force the users to work in that mode
> (e.g. All file in the repository has to have a needs-lock
> property set, every change on the repository must be on files
> locked by the transaction owner, etc)
> All the svn clients access the repository throw http and apache2
>
>
> ------------
> The problem:
> ------------
>
>
> A repository user locks a file ( fileA ) and  moves to fileB:
>        >svn lock fileA
>        >svn move fileA fileB
>
>
> So far all is ok.
>
>
> When the user commits the changes and the pre-commit fails, so
> the transaction fails, the locks between the working copy and
> the repository are inconsistent. ( e.g. the lock on
> the fileA at repository have been released ! )

I just tried to reproduce this here, and it looks like a bug to me. 
If you could file an issue that would be great.  Note that it doesn't
require apache + mod_dav_svn, you can get the same behavior with
ra_local.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org