]> arthur.barton.de Git - bup.git/commit
Add probabilistic "bup gc", but require --unsafe
authorRob Browning <rlb@defaultvalue.org>
Mon, 20 Oct 2014 23:44:06 +0000 (18:44 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 14 Feb 2016 00:10:09 +0000 (18:10 -0600)
commitc4d3e3aebd973cdb27d3c8057db05ed7f81475b8
treefb7d89c5d403171bdfdcf6fd820b9d5aa1105cfc
parentb7e10498d1834aa330b44faf682b6c5bdc8d950a
Add probabilistic "bup gc", but require --unsafe

WARNING: This code is UNSAFE, please test it with care.  Among other
things, it adds the first bup command that intends to modify packfiles.
Also, the code assumes/requires a "quiet" repository; any simultaneous
access is dangerous.

Add a "bup gc" command that uses a Bloom filter to track the live
objects during the mark phase.  This means that the collection is
probabilistic -- that it may retain some (known) percentage of
garbage, but it can also work within a reasonable, fixed RAM budget
for any particular percentage and repository size.

In many cases, this may be sufficient and preferable, but in the
longer run, we might also want to add a precise method that guarantees
bup retains *no* unreachable/dead objects -- nothing here should
prevent that.

This command is potentially dangerous, so until we've had broader
testing, require all invocations to specify --unsafe, and make it clear
in the documentation that this command isn't considered stable.

Thanks to Tim Riemenschneider for suggesting the pruning of already
visited trees, and an earlier implementation thereof.  Thanks to Ben
Kelley for testing and reporting bugs in earlier versions of the
current implementation.

Thanks to Ben Kelly for help devising this Bloom-based approach, and for
testing and reporting bugs in earlier versions.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
Documentation/bup-gc.md [new file with mode: 0644]
Makefile
cmd/gc-cmd.py [new file with mode: 0755]
lib/bup/bloom.py
lib/bup/client.py
lib/bup/git.py
lib/bup/midx.py
t/test-gc.sh [new file with mode: 0755]