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

Improve interaction between AAE and K/V deletion #477

Closed
wants to merge 2 commits into from

Conversation

jtuple
Copy link
Contributor

@jtuple jtuple commented Feb 4, 2013

This pull-request improves AAE's handling around object deletion.

First, the pull-request changes the rehash logic in riak_kv_vnode to delete AAE hashes if an object is found to be missing. Thus, if a K/V delete fails to update the relevant AAE hashtree, the hashtree will be fixed on the first repair. Without this change, AAE could continually attempt to repair keys that have been deleted without informing the relevant AAE hashtree. This is scenario is hard to trigger in practice, but it's better to be safe as the fix is easy and straightforward.

Second, this pull-request changes the AAE hashtrees to buffer deletes using the same logic used for buffering writes. Thus, both deletes and writes are buffered and submitted to LevelDB as a single batch operation. As previously shown, write-batching is necessary to make AAE have low impact on the cluster, thus this change is also important for users that frequently delete data.

This change ensures that AAE does not attempt to continually repair
deleted keys that an AAE hashtree believes still exist.
AAE already buffers writes and submits them as a single write-batch to
LevelDB for better performance. Since deletes are also valid batch
operations, this change buffers deletes alongside writes and submits
all operations as a single write-batch as necessary.

This change also fixes a potential bug in the previous approach that
could reorder a write to happen after a delete, even if the delete
occured after the write -- thus reviving a dead hash.
@jtuple
Copy link
Contributor Author

jtuple commented Feb 4, 2013

Meant to create pull-request against 1.3 branch. Closing this one out. New pull-request: #478

@jtuple jtuple closed this Feb 4, 2013
Dirty = bitarray_set(Segment, State3#state.dirty_segments),
State3#state{dirty_segments=Dirty};
State2 = enqueue_action({put, HKey, ObjHash}, State),
%% Dirty = gb_sets:add_element(Segment, State2#state.dirty_segments),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there a reason to leave this lying around?

@seancribbs seancribbs deleted the jdb-aae-deleted branch April 1, 2015 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants