Bugfix: prune user buckets#812
Conversation
This was previously hardcoded to 24-hours. This allows the pruning time to be runtime (and startup) configurable. This can help in cases where the are frequent partitions, or frequent deletion of buckets.
riak_cs_utils:fetch_user was returning the wrong boolean for `KeepDeleted` buckets. This meant that buckets were being pruned in the opposite scenario from when they should. This change also prunes buckets even when there are no siblings.
|
There was a problem hiding this comment.
pos_integer() instead of integer() like above?
|
Also I would suggest improving spec of -spec fetch_user(KeyId::binary(), pid()) ->
{ok, {riakc_obj(), ShouldKeepDeletedBuckets::boolean()}} |
{error, term()}.For clearer understanding and preventing misuse of boolean. |
|
Looks like this also fixes #799. |
|
+1 to merge regardless of above nitpick comments. Also confirmed that creating bucket after deleting another bucket removes old Eventually we'd add riak_test about this? |
There was a problem hiding this comment.
Sorry for stepping in and I don't execute this fix ...
timer:now_diff/2 returns time interval in micro seconds and riak_cs_config:user_buckets_prune_time() seems to be represented by seconds. Any mismatch??
Per review feedback on #812.
This fixes a bug where seconds were used to compare with microseconds. This would cause deleted buckets to be pruned two orders of magnitude before they were supposed to.
|
I'm re-running all tests now. |
Yes. I'd like to try and think of a way of testing it that doesn't resort to |
|
code changes look good. dialyzer is clean regarding changes. tests running now. |
|
👍 |
|
+1, yay! |
Fixes #798.