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

John Arbash Meinel john at arbash-meinel.com
Mon Oct 29 21:01:35 GMT 2007


-----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?

Unless you are deleting them before renaming the new ones into place. 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.)

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHJkouJdeBCYSNAAMRAlOqAJ40rue3ED8OTrjNTsu8AYTFfUR59gCeLxHO
gjtl5XrymSymhVPRgHcZ77c=
=2FUT
-----END PGP SIGNATURE-----



More information about the bazaar mailing list