darcs

Issue 873 get --partial requires inventory to be optimized

Title get --partial requires inventory to be optimized
Priority bug Status resolved
Milestone Resolved in
Superseder --partial get of current unstable repo fails
View: 433
Nosy List darcs-devel, dmitry.kurochkin, karel.gardas, kowey, thorkilnaur, tommy
Assigned To
Topics Partial, Regression

Created on 2008-05-22.18:48:52 by karel.gardas, last changed 2009-08-27.14:10:04 by admin.

Messages
msg4838 (view) Author: karel.gardas Date: 2008-05-22.18:48:50
it seems there is serious (performance-wise) regression in darcs2 since
it completely ignores checkpoint in darcs1 format repository. I've
tested on ghc stable repository today and darcs2 is able to get
--partial sources in 174 minutes, while darcs1 thanks to the checkpoint
in the repository is able to get the same in about 17 minutes.
msg4840 (view) Author: kowey Date: 2008-05-22.19:55:41
Assigning to myself to check darcs history: has partial support been removed?
(it lead to some trouble) or is this actually a bug?
msg4841 (view) Author: kowey Date: 2008-05-23.10:12:41
Sorry for the noise.  Partial support is still available for old-fashioned
repositories.

This looks like another instance of issue433.  That is, it may be a case of
checkpoint corruption in the GHC repository, fortunately, something that is very
easy to fix.  (For the record, I tried creating a checkpoint in my copy of the
GHC repo, and the partial get worked).

I'm going to resolve this, but let us know if you think this is wrong.  Perhaps
you should take it up with the GHC people.  You'll want them to
 mv _darcs/checkpoints _darcs/old-checkpoints
 darcs optimize --checkpoint
I'm adding Simon Marlow to this ticket, who may or may not be the best person to
contact...
msg4908 (view) Author: igloo Date: 2008-06-01.18:21:32
I've tried fixing it similar to how you suggest, but although darcs1 copes fine
with the fixed repo, darcs2 doesn't. Am I doing something wrong?


igloo@monk:/home/darcs/ghc$ mv _darcs/checkpoints
_darcs/checkpoints-darcs-issue873-2
igloo@monk:/home/darcs/ghc$ darcs tag --checkpoint
What is the version name? 2008-06-01
Finished tagging patch 'TAG 2008-06-01'
igloo@monk:/home/darcs/ghc$ darcs --version
1.0.9rc1 (release candidate 1)
igloo@monk:/home/darcs/ghc$ 

$ time darcs get -q --partial --repo-name d1 http://darcs.haskell.org/ghc/
real    3m5.985s
user    0m15.249s
sys     0m1.532s
$ ls -1 d1/_darcs/patches/ | wc -l
1
$ ls -1 d1/_darcs/patches/
20080601155241-3fd76-13b3337cedf6323aab252f8035c39326411e3614.gz
$ darcs --version
1.0.9rc1 (release candidate 1)

$ time darcs2 get -q --partial --repo-name d2 http://darcs.haskell.org/ghc/
[...]
Downloaded: 49,328,595 bytes in 18553 files
Killed
real    143m19.564s
user    1m38.798s
sys     1m27.277s
$ ls -1 d2/_darcs/patches/ | wc -l
18553
$ darcs2 --version
2.0.0 (unknown)
msg4909 (view) Author: kowey Date: 2008-06-01.18:40:05
Huh :-(

Maybe the fact that this is a remote repository is causing the problem?  For
example, if you make a checkpoint in your complete local copy, and darcs get
that, do you have a partial repository?
msg4921 (view) Author: kowey Date: 2008-06-02.14:09:57
Ok, I don't think it has anything to do with remote/local.  The inventory file
seems to play a role (perhaps a difference in the version of darcs used to
generate it).

One guess is that tag --checkpoint does not optimize the inventory, and that
this confuses darcs.  Maybe it requires the top tag to match one of the items in
the checkpoint-inventory.

Ian, could you try running a darcs optimize --checkpoint?

Does darcs2 have better luck with it?
msg4922 (view) Author: kowey Date: 2008-06-02.14:12:39
Actually, a darcs optimize seems to suffice.

I guess this is a regression in darcs2, in that it assumes that inventory files
will always be optimised when deciding if can use a checkpoint or not.
msg4923 (view) Author: igloo Date: 2008-06-02.14:44:33
Looks like that's done the trick, thanks!
msg4924 (view) Author: kowey Date: 2008-06-02.14:59:40
Ok, I guess this means we now have a non-urgent bug.

Either darcs2 needs to stop assuming the inventory is going to be optimized, or
darcs2 tag --checkpoint needs to optimize the inventory (we'd have to tell
people with earlier darcs to do a darcs optimize if this ever comes up).

I'm guessing the assumption is due to this line in
Darcs.Repository.Checkpoint.identify_checkpoint:
 pis <- (map info . catMaybes . mapRL lastRL) `liftSM` read_repo repository

Perhaps the lastRL?
msg5012 (view) Author: kowey Date: 2008-06-12.08:17:13
For some reason, the auto-resolver did not pick up this patch

Tue Jun  3 12:47:07 BST 2008  David Roundy <droundy@darcs.net>
  * resolve issue873: always optimize inventory when adding a tag to old-format
repositories.
History
Date User Action Args
2008-05-22 18:48:52karel.gardascreate
2008-05-22 19:52:47koweylinkissue874 superseder
2008-05-22 19:55:47koweysetstatus: unread -> unknown
priority: bug
title: darcs2 seems to ignore checkpoint in darcs1 repository -> darcs2 get --partial gets the whole repository
nosy: + karel.gardas, kowey, - karel.gardas
messages: + msg4840
topic: + Performance, Partial, Regression
assignedto: kowey
2008-05-23 10:12:45koweysetstatus: unknown -> resolved
nosy: + simonmar, simon
topic: + FauxBug, - Performance, Regression
superseder: + --partial get of current unstable repo fails
messages: + msg4841
2008-05-23 10:14:03koweysetnosy: tommy, beschmi, kowey, dagit, simonmar, simon, karel.gardas
assignedto: kowey ->
2008-06-01 18:21:34igloosetstatus: resolved -> unknown
nosy: + igloo
messages: + msg4908
2008-06-01 18:40:08koweysettopic: - FauxBug
nosy: tommy, beschmi, kowey, dagit, igloo, simonmar, simon, karel.gardas
messages: + msg4909
2008-06-02 14:10:00koweysetnosy: + droundy, - simonmar, simon
messages: + msg4921
2008-06-02 14:12:41koweysetnosy: droundy, tommy, beschmi, kowey, dagit, igloo, karel.gardas
messages: + msg4922
2008-06-02 14:44:34igloosetnosy: droundy, tommy, beschmi, kowey, dagit, igloo, karel.gardas
messages: + msg4923
2008-06-02 14:59:48koweysetstatus: unknown -> has-patch
nosy: droundy, tommy, beschmi, kowey, dagit, igloo, karel.gardas
topic: + Regression
messages: + msg4924
title: darcs2 get --partial gets the whole repository -> get --partial requires inventory to be optimized
2008-06-12 08:17:14koweysetstatus: has-patch -> resolved-in-unstable
nosy: droundy, tommy, beschmi, kowey, dagit, igloo, karel.gardas
messages: + msg5012
2008-09-04 21:33:33adminsetstatus: resolved-in-unstable -> resolved
nosy: droundy, tommy, beschmi, kowey, dagit, igloo, karel.gardas
2009-08-06 17:58:55adminsetnosy: + markstos, jast, Serware, dmitry.kurochkin, darcs-devel, zooko, mornfall, simon, thorkilnaur, - droundy, igloo, karel.gardas
2009-08-06 21:05:41adminsetnosy: - beschmi
2009-08-10 22:20:53adminsetnosy: + karel.gardas, igloo, - markstos, darcs-devel, zooko, jast, Serware, mornfall
2009-08-11 00:15:05adminsetnosy: - dagit
2009-08-25 17:19:32adminsetnosy: + darcs-devel, - igloo
2009-08-25 18:08:56adminsetnosy: - simon
2009-08-27 14:10:04adminsetnosy: tommy, kowey, darcs-devel, thorkilnaur, dmitry.kurochkin, karel.gardas