Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change riak_kv_bitcask_backend to use bitcask:is_empty_estimate #424

Merged
merged 1 commit into from
Nov 6, 2012

Conversation

jtuple
Copy link
Contributor

@jtuple jtuple commented Nov 2, 2012

Previously, determining if a bitcask was empty or not was accomplished through a fold over the keydir which is a potentially blocking operation. This commit changes riak_kv_bitcask_backend:is_empty to use the new function bitcask:is_empty_estimate.

The estimate is determined from the bitcask stats, which may overcount data, but will not undercount. Therefore, the estimated result may return false when the bitcask is actually empty, but it will never return true when there is data. In all cases where is_empty is currently used in Riak, an estimate is acceptable. In the worst case, additional work may be triggered that is unnecessary but safe (eg. folding over an empty bitcask).

See issue: #423

Previously, determining if a bitcask was empty or not was accomplished
through a fold over the keydir which is a potentially blocking operation.
This commit changes riak_kv_bitcask_backend:is_empty to use the new
function bitcask:is_empty_estimate.

The estimate is determined from the bitcask stats, which may overcount
data, but will not undercount. Therefore, the estimated result may return
false when the bitcask is actually empty, but it will never return true
when there is data. In all cases where is_empty is currently used in
Riak, an estimate is acceptable. In the worst case, additional work may
be triggered that is unnecessary but safe (eg. folding over an empty
bitcask).

See issue: #423
@ghost ghost assigned reiddraper and jtuple Nov 3, 2012
@reiddraper
Copy link
Contributor

+1

jaredmorrow added a commit that referenced this pull request Nov 6, 2012
Change riak_kv_bitcask_backend to use bitcask:is_empty_estimate
@jaredmorrow jaredmorrow merged commit b967b56 into master Nov 6, 2012
@seancribbs seancribbs deleted the gh_riak_kv_423-bitcask-stall branch April 1, 2015 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants