gc: implement "mini" gc
commit3186b9629321d8361859b5e7f9c2999acc88b714
authorKyle J. McKay <mackyle@gmail.com>
Fri, 3 Jun 2016 09:33:41 +0000 (3 02:33 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Fri, 3 Jun 2016 09:33:41 +0000 (3 02:33 -0700)
tree5c4e0e53c2c16f930cc176e0c8e0d18b120fcfb6
parentbe2ede611f5d20e6687b0890bd51c893fffe1135
gc: implement "mini" gc

A "mini" gc is triggered when we have too many packs but it's not
yet time for a full gc.  A git-svn fetch can also trigger a "mini"
gc in order to combine the git-svn fetched loose objects into a pack.

A "mini" gc attempts to reduce the number of packs by combining them.
This is generally much cheaper to do than a full gc.

If, however, that does not result in a sufficient reduction in the
number of pack files (packs with a very large number of objects are
not combined in a "mini" gc) then a full gc will be triggered as
a last resort (which will then happen the next time jobd processes
the project).

Other than for git-svn fetches, generally more than two updates
per day (an "update" being either a fetch or receive that actually
gets new objects) is required to trigger a "mini" gc before the
next scheduled full gc.  And in the case of git-svn, that's still
the case in order for a "mini" gc to do anything other than just
combine the git-svn fetched loose objects into a pack.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
jobd/gc.sh
jobd/jobd.pl