Add a `clean` command that deletes obsolete packs and uploads

Bug #373539 reported by Tim Penhey
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

I have just been testing the brisbane core format and branching a single new branch locally into another repository left a significant amount of obsolete packs. Now reading bug 304320 seems to indicate that it is undesirable to remove these pack files as part of the command implementation.

How about a new command to clean up the repository?

I checked my other repository that contained the branch that I was branching from, and I noticed 101M of obsolete packs, and 60M in the upload directory. Now I know that nothing is going on on that machine either uploading to it nor pushing from it. However I don't know when is a "safe" time to remove code from these directories, but I do know that they are not giving a favourable size comparison against other DVCSs.

Revision history for this message
Martin Pool (mbp) wrote :

Making this a separate command rather than an option to pack doesn't make any difference. Let's just add the option as in bug 304320

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 373539] [NEW] Add a `clean` command that deletes obsolete packs and uploads

On Fri, 2009-05-08 at 03:56 +0000, Tim Penhey wrote:
>
> I checked my other repository that contained the branch that I was
> branching from, and I noticed 101M of obsolete packs, and 60M in the
> upload directory. Now I know that nothing is going on on that machine
> either uploading to it nor pushing from it. However I don't know when
> is a "safe" time to remove code from these directories, but I do know
> that they are not giving a favourable size comparison against other
> DVCSs.

Just to note - stuff in uploads should be deleted; with the smart server
we should be quite good at deleting that these days. It would be
reasonable for 'check' to report on noise in uploads.

-Rob

Revision history for this message
Tim Penhey (thumper) wrote :

I don't think this is a duplicate.

Robert has indicated that there are times when the obsolete packs shouldn't be removed as part of pack.

Having a `bzr pack --delete-obsolete-packs` that doesn't actually pack seems wrong to me.

Having a command that explicitly removes old "stuff" seems more intuitive. It is more than just obsolete_packs, but the upload directory too.

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 373539] Re: Add a `clean` command that deletes obsolete packs and uploads

Other tools have a fsck command; 'bzr check' is our equivalent. Perhaps
a flag to check to repair things it can [and another to not spend days
getting to cleanup upload and obsolete-packs].

-Rob

Revision history for this message
John A Meinel (jameinel) wrote :

Just mentioning that since we have 'clean-tree', 'clean-repository' or 'clean-repo' would seem to be an appropriate name.

I think other systems also tend to have something like 'garbage-collect' ('gc'). Which unreferenced data in 'obsolete_packs' and 'upload' would fit.

Also, last I checked deleting an upload file will appropriately kill the running process when it tries to install the file. It *might* first create unreferenced indexes in the 'indices' directory, so we probably also want to prune unreferenced items from there. You also can have .pack files in packs/ which are unreachable (because they are not listed in pack-names). This is usually pretty rare, but it would also be something along the same lines for what to collect.

We could alternatively introduce a garbage-collect command, that would start at just doing this, and then grow the functionality to remove revisions/inventories/texts that are not referenced. (Note that those sorts of things start to become dangerous in the presence of things like stacked-branches, where we can no longer tell what revisions are *actually* referenced.)

Martin Pool (mbp)
Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Jelmer Vernooij (jelmer)
tags: added: packs
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.