You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Alexander Lüders <al...@entimo.de> on 2014/02/06 11:54:31 UTC
Irrevocably locked working copy after svn delete
Dear Subversion team,
I want to file a bug report affecting the most recent released version 1.8.5.
Whenever I issue asvn delete on a versioned file on which the subversion client does not have any access rights, the working copy is irrevocably locked until the file is deleted manually by other means.
Environment:
* Intel i7 2.6Ghz cpu
* 8Gb RAM
* Windows 7 x64 Professional
* Subversion 1.8.5 x86 (downloaded from Collabnet)
Scenario:
1) svnadmin create testrepo
2) set anonymous access to write
3) svnserve -d --listen-host=localhost --listen-port=4444 --root=testrepo
4) svn cosvn://localhost:4444/ wc
5) cd wc
6) echo Hello Subversion! > testfile
7) svn add testfile
8) svn commit -m "initial commit"
9) now remove any read/write/execution rights on testfile for user that executes subversion client
10) svn delete testfile (fails as expected)
> svn: E155009: Failed to run the WC DB work queue associated with
> 'G:\svnlog\wc\test', work item 4 (file-remove test) svn: E720005:
> Can't set file 'G:\svnlog\wc\testfile' read-write: Zugriff verweigert
11) now any subsequent working copy operation (e.g. svn status) fails with
> svn: E155037: Previous operation has not finished; run 'cleanup' if it
> was interrupted
12) cleanup fails with
> svn: E155009: Failed to run the WC DB work queue associated with 'G:\svnlog\wc', work item 4 (file-remove test)
> svn: E720005: Can't set file 'G:\svnlog\wc\testfile' read-write: Zugriff verweigert
I did a similar test trying to commit modifications on a modified versioned file which cannot be accessed by subversion client either.
The commit fails as expected but the working copy remains alive, i.e. other svn operations are still possible.
I hope you will be able to reproduce the problem and may assist me in solving it.
Many thanks in advance.
Greets
Alexander Lüders
--
Entimo AG
Stralauer Platz 33 - 34 | 10243 Berlin | Germany
Tel: +49.30.52 00 24 131 | Fax: +49.30.52 00 24 101
alu@entimo.com |http://www.entimo.com/
Vorstand: Jürgen Spieler (Vors.), Marianne Neumann
Aufsichtratsvorsitzender: Erika Tannenbaum
Sitz der Gesellschaft: Berlin, Germany | Handelsregister: HRB Berlin-Charlottenburg 85073
Re: Irrevocably locked working copy after svn delete
Posted by Ben Reser <be...@reser.org>.
On 2/6/14, 5:47 AM, Stefan Sperling wrote:
> Arguably, we could add a check of the on-disk state before we delete
> the file in meta data. But implications would have to be investigated
> first (whether to completely fail in the recursive delete case,
> whether this would hurt performance a lot, etc.).
Such a check would only protect against lacking permissions when that check was
made. You'd still have the possibility for the WC to get in this state if the
permission changed between that check and the execution of the work queue.
The error message seems easy enough to understand in my opinion:
svn: E155009: Failed to run the WC DB work queue associated with
'/Users/breser/wedged-wc/wc', work item 4 (file-remove foo)
svn: E000013: Can't remove file '/Users/breser/wedged-wc/wc/foo': Permission denied
I'd expect most people could figure out that they need to resolve the
permission issue and run cleanup again. So I don't think there's much benefit
in such a check.
Re: Irrevocably locked working copy after svn delete
Posted by Alexander Lüders <al...@entimo.de>.
Hi,
thank you very much for your detailed answer.
> Arguably, we could add a check of the on-disk state before we delete
> the file in meta data. But implications would have to be investigated
> first (whether to completely fail in the recursive delete case,
> whether this would hurt performance a lot, etc.).
Don't worry. This is most probably an edge case and does not affect many
users.
As you stated already we just have to make sure that the entries in the
working copy have read/write access.
After all we will have to and can live with it...
Thanks a lot for your time
Best regards,
Alexander Lüders
Am 06.02.2014 14:47, schrieb Stefan Sperling:
> On Thu, Feb 06, 2014 at 02:11:45PM +0100, Alexander Lüders wrote:
>> So after the failed svn delete a subsequent cleanup would try to finish the
>> unfinished delete?
> Well, here's how the mechanics work in some more detail:
>
> The deletion in meta data doesn't fail. It adds a base-deleted row
> for the file to the NODES table in wc.db and also adds a work queue
> item which will be run later to delete the on-disk file, once the entire
> deletion (which is possibly recursive in the general case) has been
> committed to wc.db. If this fails part of the way through for some
> reason, all meta-data changes are rolled back, and no change happens.
>
> It's the deletion of the on-disk file that is failing, when the work
> queue is run, after all related meta-data changes have been completed.
>
> 'svn cleanup' simply tries to run the work queue to get the working
> copy into a consistent state. It doesn't know how to undo completed
> meta data modifications.
>
>> I just wonder why it's different for a svn commit of a versioned modified
>> file. Applying the same access restrictions on a modified file do not result
>> in a "locked" working copy after a failed commit. I.e. the commit fails and
>> no cleanup is necessary to retry the unfinished commit, which eventually
>> would fail again.
> File modifications are not managed as part of the meta data.
> They are detected on the fly during the commit process by comparing
> file timestamps and sizes to values recorded in meta data during
> checkout/update, and even comparing file content if necessary.
>
>> I don't understand why it is necessary to retry the failed delete (keeping
>> it in the journal) at all.
> Because the operations is done in meta data first and then on disk.
>
> Arguably, we could add a check of the on-disk state before we delete
> the file in meta data. But implications would have to be investigated
> first (whether to completely fail in the recursive delete case,
> whether this would hurt performance a lot, etc.).
--
Entimo AG
Stralauer Platz 33 - 34 | 10243 Berlin | Germany
Tel: +49.30.52 00 24 131 | Fax: +49.30.52 00 24 101
alu@entimo.com | http://www.entimo.com/
Vorstand: Jürgen Spieler (Vors.), Marianne Neumann
Aufsichtratsvorsitzender: Erika Tannenbaum
Sitz der Gesellschaft: Berlin, Germany | Handelsregister: HRB Berlin-Charlottenburg 85073
Re: Irrevocably locked working copy after svn delete
Posted by Stefan Sperling <st...@elego.de>.
On Thu, Feb 06, 2014 at 02:11:45PM +0100, Alexander Lüders wrote:
> So after the failed svn delete a subsequent cleanup would try to finish the
> unfinished delete?
Well, here's how the mechanics work in some more detail:
The deletion in meta data doesn't fail. It adds a base-deleted row
for the file to the NODES table in wc.db and also adds a work queue
item which will be run later to delete the on-disk file, once the entire
deletion (which is possibly recursive in the general case) has been
committed to wc.db. If this fails part of the way through for some
reason, all meta-data changes are rolled back, and no change happens.
It's the deletion of the on-disk file that is failing, when the work
queue is run, after all related meta-data changes have been completed.
'svn cleanup' simply tries to run the work queue to get the working
copy into a consistent state. It doesn't know how to undo completed
meta data modifications.
> I just wonder why it's different for a svn commit of a versioned modified
> file. Applying the same access restrictions on a modified file do not result
> in a "locked" working copy after a failed commit. I.e. the commit fails and
> no cleanup is necessary to retry the unfinished commit, which eventually
> would fail again.
File modifications are not managed as part of the meta data.
They are detected on the fly during the commit process by comparing
file timestamps and sizes to values recorded in meta data during
checkout/update, and even comparing file content if necessary.
> I don't understand why it is necessary to retry the failed delete (keeping
> it in the journal) at all.
Because the operations is done in meta data first and then on disk.
Arguably, we could add a check of the on-disk state before we delete
the file in meta data. But implications would have to be investigated
first (whether to completely fail in the recursive delete case,
whether this would hurt performance a lot, etc.).
Re: Irrevocably locked working copy after svn delete
Posted by Alexander Lüders <al...@entimo.de>.
Hi,
thanks for your quick response.
> Subversion must ensure that working copy meta data
> and the on-disk state are kept in sync.
I totally agree.
> The working copy has a work
> queue that acts like a journal in the sense that it attempts to replay
> any unfinished operations before allowing further operations on the
> working copy.
So after the failed svn delete a subsequent cleanup would try to finish
the unfinished delete?
I just wonder why it's different for a svn commit of a versioned
modified file. Applying the same access restrictions on a modified file
do not result in a "locked" working copy after a failed commit. I.e. the
commit fails and no cleanup is necessary to retry the unfinished commit,
which eventually would fail again.
I don't understand why it is necessary to retry the failed delete
(keeping it in the journal) at all.
> You simply need to make
> sure that files in the working copy are read/write.
I did not know that yet.
Many thanks
Best regards,
Alexander Lüders
Am 06.02.2014 12:22, schrieb Stefan Sperling:
> On Thu, Feb 06, 2014 at 11:54:31AM +0100, Alexander Lüders wrote:
>> Dear Subversion team,
>>
>> I want to file a bug report affecting the most recent released version 1.8.5.
>> Whenever I issue asvn delete on a versioned file on which the subversion client does not have any access rights, the working copy is irrevocably locked until the file is deleted manually by other means.
>>
>> 12) cleanup fails with
>>> svn: E720005: Can't set file 'G:\svnlog\wc\testfile' read-write: Zugriff verweigert
> This is by design. Subversion must ensure that working copy meta data
> and the on-disk state are kept in sync. The working copy has a work
> queue that acts like a journal in the sense that it attempts to replay
> any unfinished operations before allowing further operations on the
> working copy. If deleting an on-disk file is impossible, then keeping
> the meta data of a deleted file in sync with the on-disk state is impossible.
>
> The only alternative behaviour I could think of is for svn to error
> out right away if asked to operate on a file it cannot access.
> However this isn't trivial to do in general because the file could
> be somewhere deep within a directory tree and Subversion would have
> to look for it before doing anything. It also wouldn't be much better
> than the current behaviour, except perhaps that the error message would
> be clearer (something like "svn: cannot operate on files with no access
> permission").
>
> Note that Subversion doesn't version permission bits beyond the 'x' bit
> (the 'executable' bit on UNIX-like systems).
> It doesn't really care about other permission bits, except that it tries
> to preverse them when moving/copying files etc. You simply need to make
> sure that files in the working copy are read/write.
--
Entimo AG
Stralauer Platz 33 - 34 | 10243 Berlin | Germany
Tel: +49.30.52 00 24 131 | Fax: +49.30.52 00 24 101
alu@entimo.com | http://www.entimo.com/
Vorstand: Jürgen Spieler (Vors.), Marianne Neumann
Aufsichtratsvorsitzender: Erika Tannenbaum
Sitz der Gesellschaft: Berlin, Germany | Handelsregister: HRB Berlin-Charlottenburg 85073
Re: Irrevocably locked working copy after svn delete
Posted by Stefan Sperling <st...@elego.de>.
On Thu, Feb 06, 2014 at 11:54:31AM +0100, Alexander Lüders wrote:
> Dear Subversion team,
>
> I want to file a bug report affecting the most recent released version 1.8.5.
> Whenever I issue asvn delete on a versioned file on which the subversion client does not have any access rights, the working copy is irrevocably locked until the file is deleted manually by other means.
>
> 12) cleanup fails with
> >svn: E720005: Can't set file 'G:\svnlog\wc\testfile' read-write: Zugriff verweigert
This is by design. Subversion must ensure that working copy meta data
and the on-disk state are kept in sync. The working copy has a work
queue that acts like a journal in the sense that it attempts to replay
any unfinished operations before allowing further operations on the
working copy. If deleting an on-disk file is impossible, then keeping
the meta data of a deleted file in sync with the on-disk state is impossible.
The only alternative behaviour I could think of is for svn to error
out right away if asked to operate on a file it cannot access.
However this isn't trivial to do in general because the file could
be somewhere deep within a directory tree and Subversion would have
to look for it before doing anything. It also wouldn't be much better
than the current behaviour, except perhaps that the error message would
be clearer (something like "svn: cannot operate on files with no access
permission").
Note that Subversion doesn't version permission bits beyond the 'x' bit
(the 'executable' bit on UNIX-like systems).
It doesn't really care about other permission bits, except that it tries
to preverse them when moving/copying files etc. You simply need to make
sure that files in the working copy are read/write.