"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: gotadmin pack/cleanup leave loose objects
To:
Christian Weisgerber <naddy@mips.inka.de>
Cc:
gameoftrees@openbsd.org
Date:
Wed, 9 Feb 2022 16:17:43 +0100

Download raw body.

Thread
On Wed, Feb 09, 2022 at 03:58:19PM +0100, Christian Weisgerber wrote:
> After running "gotadmin pack" on a FreeBSD src repository consisting
> of all loose objects, I also ran "gotadmin cleanup":
> 
> 4069139 loose objects; 377383 commits scanned; 4069109 objects purged
> loose total size before: 14.8G
> loose total size after: 24.9K
> disk space freed: 14.8G
> loose objects also found in pack files: 4068040
> 
> Wait, why are there 30 loose objects left?  It's not an accounting
> error, they are there under objects/[0-9a-f][0-9a-f]/.  If they are
> reachable, they should have been packed.  If they are unreachable,
> "cleanup" should have also removed them.

There is a safety margin based on timestamps which leaves
recently created loose objects alone.

Locking is done on a per-object file level which is too fine-grained
to ensure that gotadmin cleanup won't interfere with other operations
which happen in parallel and create loose objects.

The -a option for 'gotadmin cleanup' disables this behaviour:

	       -a      Delete all loose objects.  By default, objects which
		       are newer than an implementation-defined modification
		       timestamp are kept on disk to prevent race conditions
		       with other commands that add new objects to the
		       repository while gotadmin cleanup is running.