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

Sort AAE differences before acting upon them via read-repair #646

Merged
merged 5 commits into from
Oct 5, 2013

Conversation

slfritchie
Copy link
Contributor

        %% Sort the keys.  For vnodes that use backends that preserve
        %% lexicographic sort order for BKeys, this is a big
        %% improvement.  For backends that do not, e.g. Bitcask, sorting
        %% by BKey is unlikely to be any worse.  For Riak CS's use
        %% pattern, sorting may have some benefit since block N is
        %% likely to be adjacent on disk to block N+1.

@ghost ghost assigned slfritchie Sep 5, 2013
@ghost ghost assigned engelsanchez Sep 30, 2013
@@ -117,6 +117,7 @@
local_compare/2,
compare/2,
compare/3,
compare/4,
Copy link
Contributor

Choose a reason for hiding this comment

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

I would be in favor of reducing the number of convenience variations of this function, but that can be done later. Notice that in the documentation at the beginning of the file compare/2 and compare/3 are explicitly named.

Copy link
Contributor

Choose a reason for hiding this comment

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

ooh, i just realized. This file is not in riak_kv any more. It has been in core since #652

Copy link
Contributor

Choose a reason for hiding this comment

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

another note, more pertinent to the original comment. Adding compare/4 would be useful for simplifying some of the code in hashtree_tree.erl.

Copy link
Contributor

Choose a reason for hiding this comment

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

BTW I like compare/4. I would keep it and eye the others for cleanup. Again, not pressing now.

@engelsanchez
Copy link
Contributor

I'm done going over the code now. The comments I had were very minor, with the only little issue being the inconsistency of riak_kv_index_hashtree:compare/2 and the handling of the undefined AccFun (just getting rid of compare/2 would do). I'll be testing this tomorrow.

@engelsanchez
Copy link
Contributor

And of course, the other "minor" issue of a file having completely moved out of the repo that Jordan mentioned :)

The only Dialyzer differences between the base of the branch
and the tip is the line numbers for the complaints that
are present.
These functions are only used by tests and by developer
scaffolding.  See also:
#646 (comment)
@slfritchie
Copy link
Contributor Author

I think I've addressed all of the review comments. Dialyzer appears happy enough: the total number of warnings has dropped, and no new warnings have been added.

@slfritchie
Copy link
Contributor Author

Oh, oops. So I patched a hashtree.erl that's now a ghost?

@engelsanchez
Copy link
Contributor

@slfritchie yes, we should do that simple hashtree patch in a separate PR in its new home in riak_core and update this. After that and a bit of testing on the final code, assuming it's all good, I should be able to give you a quick +1

@slfritchie
Copy link
Contributor Author

Engel: basho/riak_core#411

@engelsanchez
Copy link
Contributor

I believe the comments have been addressed. I've verified sorted AAE repairs manually. EUnit tests have only failures that I've observed lately in the develop branch (get_put_monitor_eqc, crdts) but that don't seem to happen in the builder machines. It looks good. 👍 💃

I'm going to push a manual merge that I used for testing that takes care of the moved hashtree files.

@engelsanchez engelsanchez merged commit 0cec637 into develop Oct 5, 2013
@engelsanchez engelsanchez deleted the slf-aae-sort-difflist branch October 5, 2013 00:44
Licenser pushed a commit to Kyorai/riak_core that referenced this pull request Nov 15, 2013
Apply patch to hashtree.erl that was developed for
basho/riak_kv#646.
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