basho/riak_cs — pull request #798 by reiddraper (2014-02-20 01:34:57+00:00)
Title: The history of bucket activity for a user is never pruned

The [records](https://github.com/basho/riak_cs/blob/develop/include/riak_cs.hrl#L50) stored for Riak CS users maintain a list of [bucket records](https://github.com/basho/riak_cs/blob/develop/include/riak_cs.hrl#L67). This list of buckets provides a causal history of bucket creation and deletion for a user and allows us to select a proper resolution when the user record has sibling values that contain conflicting views of the user's bucket ownership.

The problem is that this history is never pruned. If a user creates and deletes many different buckets then the set continuously grows. In the case when there are no siblings for the user record this poses little problem; however, in the case of siblings this has a negative impact on latencies because for each the lists of buckets for each sibling value must be compared and resolved. As the number of siblings and buckets contained in those siblings grows so does the processing time required to do the resolution.

The reason this really becomes an issue is that there are a very few cases involving explicit API actions that we update the user record (*e.g.* updating the user's status). As a result if siblings are generated for a user record the bucket resolution happens for every API request by that user until the record is updated.