bugmonotone - Bugs: bug #18125, 'mtn update' is not atomic; leaves...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #18125: 'mtn update' is not atomic; leaves workspace in a corrupted state on error

Submitted by:  Ian Prest <ijprest>
Submitted on:  Thu 26 Oct 2006 11:29:56 PM UTC  
 
Category: error handlingSeverity: 4 - Important
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open
mtn version --full: 

monotone 0.30 (base revision: unknown)
Running on : Windows NT/2000/XP/2003 (5.1, build 2600, Service Pack 2) on ia32 (level 15, rev 8962)
C++ compiler : GNU C++ version 3.4.2 (mingw-special)
C++ standard library: GNU libstdc++ version 20040907
Boost version : 1_33_1
Changes since base revision:
unknown

(Why is this post is considered to be spam? Users may have reported it to be spam or, if it has been recently posted, it may just be waiting for spamchecks to be run.)
Spam content:

http://oszone.info
Anonymous
Thu 26 Oct 2006 11:29:56 PM UTC, original submission:

If 'update' fails (e.g., if it tried to update a file that was read-only), the workspace can be left in a corrupted state. Even if the cause of the error is fixed, running 'mtn update' a second time will again fail (for new reasons).

For example:
------------

> mtn update

mtn: updating along branch 'root'
mtn: selected update target f57a6687bd6fd8c152cc04f04a140490406fc14d
mtn: adding foo/a
mtn: adding foo/a/a
mtn: adding foo/a/b
mtn: modifying foo/1
mtn: error: renaming '_MTN/data.tmp.2968' to 'foo/1' failed: Access is denied. (5)
------------

Oops! foo/1 was read only, so the update failed. Fix the problem, and try again:
------------

> mtn update

mtn: updating along branch 'root'
mtn: selected update target f57a6687bd6fd8c152cc04f04a140490406fc14d
mtn: misuse: path 'foo/a' already exists, cannot create
------------

So I guess we'll need to delete the new directory (foo/a) that was added and try again:
------------

> mtn update

mtn: updating along branch 'root'
mtn: selected update target f57a6687bd6fd8c152cc04f04a140490406fc14d
mtn: misuse: path _MTN/tmp/1 already exists
------------

And it still didn't work, this time because Monotone failed to clean up it's temporary files. (FWIW, fixing this error will allow update to succeed in this example.)

This is very frustrating. For large databases, it might require significant work to get the workspace back to a good state. (It's often easier to start from scratch with 'mtn checkout', but then you'd lose any existing work.)

Note that you get similar problems if the first update deleted files:
------------

> mtn update

mtn: updating along branch 'root'
mtn: selected update target 8307d0c5809fe45349302d6c512d810448c81a99
mtn: dropping foo/aaa/a
mtn: dropping foo/aaa
mtn: modifying foo/2
mtn: error: renaming '_MTN/data.tmp.3928' to 'foo/2' failed: Access is denied. (5)

> fix the problem


> mtn update

mtn: updating along branch 'root'
mtn: selected update target 8307d0c5809fe45349302d6c512d810448c81a99
mtn: warning: missing foo/aaa/a
mtn: misuse: 1 missing files; use 'mtn ls missing' to view
mtn: misuse: To restore consistency, on each missing file run either
mtn: misuse: 'mtn drop FILE' to remove it permanently, or
mtn: misuse: 'mtn revert FILE' to restore it.
mtn: misuse: To handle all at once, simply use
mtn: misuse: 'mtn drop --missing' or
mtn: misuse: 'mtn revert --missing'
------------

Ian Prest <ijprest>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

No Changes Have Been Made to This Item

Back to the top


Powered by Savane 3.1-cleanup