basho/riak_cs — pull request #470 by kellymclaughlin (2014-01-03 04:31:05+00:00)
Title: Allow objects to be reaped sooner than leeway interval.

Change how manifest delete marking works so that objects may be cleaned up prior to the expiration of the leeway interval. The current scheme works by writing the deleted or overwritten manifest version to a garbage collection bucket with a key that is representative of a timestamp in the future when the blocks of the object represented by the manifest are eligible to actually be deleted. The garbage collection daemon periodically checks the garbage collection bucket for keys that represent a time that is in the past and judges any such key as eligible to be reaped.

The problem with this is approach is that there is not a way to override the leeway interval in the case of a disk space shortage, bloated manifests, or situations where the system may be under stress. To improve this situation the process should be upended so that the keys written to the GC bucket are representative of the current time and not a future point in time and the enforcement of the `leeway_interval` should be done by the GC daemon. This would allow early cleanup of garbage to be accomplished even after a manifest is written to the GC bucket.

The goals of this work are as follows:

- [ ] Change the keys written to the GC bucket to be representative of the current time instead of a time in the future
- [ ] Move enforcement of the `leeway_interval` to the GC daemon
- [ ] Provide a way to override the default `leeway_interval` from the `riak-cs-gc` tool