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

Make dvv_enabled a bucket property #891

Merged
merged 4 commits into from
Apr 4, 2014
Merged

Conversation

russelldb
Copy link
Member

Set it's default to false on legacy/default buckets
Set it's default to true on typed buckets

Update all the tests and associated places this change touches

jtuple and others added 4 commits January 24, 2014 00:50
First, remove unnecessary dict -> list -> dict conversion. This conversion
was previously added to address a bug arising from equivalent dicts having
different structure (and thus not comparing equal as terms). Rather than
performing the conversion, this commit uses a custom comparison function
to achieve the same effect. The new comparison approach exits early in the
common case. Even in the uncommon case, the comparison function only does
a dict -> list conversion, avoiding the final list -> dict from before.

Second, change fold_contents/3 to not use an ordset for tracking kept
siblings (which has O(N^2) complexity), but instead construct a simple
list (with possible duplicates) that is then sorted/filtered at the end.

In micro-benchmarking, this commit improved non-DVV merging by 10x, and
DVV merging by 2x.
Set it's default to `false` on legacy/default buckets
Set it's default to `true` on typed buckets

Update all the tests and associated places this change touches
@russelldb russelldb added this to the 2.0-RC milestone Apr 4, 2014
@russelldb
Copy link
Member Author

Sorry @cmeiklejohn do not have the time/patience to put the optimisations and bucket prop stuff as separate things. Feel free to do it yourself, though.

@cmeiklejohn
Copy link
Contributor

Do any of the tests specifically test the false case? The case where the bucket is mecked to return [] and [dvv_enabled] both end up executing the true case, since the default of the get_value is true.

@cmeiklejohn
Copy link
Contributor

Other than that, I'm 👍 on this changeset.

@russelldb
Copy link
Member Author

I didn't write new tests, no. I can write some on Monday, or you can add some if you like.

@cmeiklejohn
Copy link
Contributor

Cool, just wanted to make sure you didn't think something was tested that wasn't. I'd say merge.

@russelldb
Copy link
Member Author

Oh, it needs basho/riak_core#568

russelldb added a commit that referenced this pull request Apr 4, 2014
Make `dvv_enabled` a bucket property
@russelldb russelldb merged commit 05c6cdc into develop Apr 4, 2014
@russelldb russelldb deleted the rdb/dvv-bucket-prop branch April 4, 2014 20:33
@@ -294,6 +295,41 @@ merge_contents(NewObject, OldObject, true) ->
riak_kv_crdt:log_merge_errors(Bucket, Key, CRDT, Error),
merge_acc_to_contents(MergeAcc).

%% Optimisation. To save converting every meta dict to a list sorting,
%% comapring, and coverting back again, we use this optimisation, that
Copy link
Contributor

Choose a reason for hiding this comment

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

comparing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Late to the game, but well spotted. New branch and PR? Or live with it like "referer"?

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

4 participants