[MERGE] * Obsolete packs are now cleaned up by pack and autopack operations.

Robert Collins robertc at robertcollins.net
Mon Oct 29 21:24:03 GMT 2007


On Mon, 2007-10-29 at 16:01 -0500, John Arbash Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Robert Collins wrote:
> > This patch cleans up obsolete packs as we go. This is a performance win
> > because hundreds or thousands of old packs make a significant
> > difference.
> > 
> > Possibly the _save_pack_names method should be renamed, and also
> > possibly the pack obsolescing should be done in the same method within
> > the lock.
> > 
> > Feedback please.
> > 
> > -Rob
> > 
> 
> +            # now clear out the obsolete packs directory
> +            if clear_obsolete_packs:
> +                self.transport.clone('obsolete_packs').delete_multi(
> +                    self.transport.list_dir('obsolete_packs'))
> 
> ^- This seems a little odd. Why not
> 
> obsolete_pack_transport = self.transport.clone('obsolete_packs')
> obsolete_pack_transport.delete_multi(obsolete_pack_transport.list_dir('.'))
> 
> I'm not sure that I like autopack deleting them...
> 
> Why not just delete them in place, rather than renaming and then deleting them?

We don't.

> Unless you are deleting them before renaming the new ones into place. 

We do.

> Which
> means you will carry around 1 copy of the last set of packs, but older ones
> will be removed. That is probably my favorite, since if they have been sitting
> in there, they are unlikely to ever be referenced. And it would still let us
> have the redirect transport which just re-issues a request from "packs/foo" to
> "obsolete_packs/foo" on a NoSuchFile error. (Which is a simple way of working
> around the code doesn't retry bug.)

Exactly.

-Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071030/d522d78c/attachment.pgp 


More information about the bazaar mailing list