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

Remove expired on get race #191

Closed
engelsanchez opened this issue Sep 9, 2014 · 1 comment
Closed

Remove expired on get race #191

engelsanchez opened this issue Sep 9, 2014 · 1 comment

Comments

@engelsanchez
Copy link
Contributor

While documenting the read code path, I came across a race when reads find an expired value. The code then unconditionally removes that entry. BUT, this is not an atomic operation. A new value could have been written between the time we found the expired entry and the time we delete it. This needs to be changed to a conditional delete that will only remove the entry if it's exactly the same one we found, or try again if it has changed since the first get.

This is the line in bitcask:get/3 that does it: bitcask.erl#L238

@engelsanchez
Copy link
Contributor Author

Fixed in the 1.7 branch by #192. A separate issue will track the merge of this and other fixes for the Riak 2.0.1 release to the develop branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants