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

Use the deep equality check for riak_objects. #712

Merged
merged 1 commit into from
Oct 25, 2013

Conversation

cmeiklejohn
Copy link
Contributor

Since some of the objects stored in the r_object are items like dicts,
etc where the internal representation can change; ensure that we perform
the deep equality check.

Since some of the objects stored in the r_object are items like dicts,
etc where the internal representation can change; ensure that we perform
the deep equality check.
@evanmcc
Copy link
Contributor

evanmcc commented Oct 25, 2013

lgtm but haven't had time to test.

@vinoski
Copy link
Contributor

vinoski commented Oct 25, 2013

+1, looks good.

cmeiklejohn added a commit that referenced this pull request Oct 25, 2013
Use the deep equality check for riak_objects.
@cmeiklejohn cmeiklejohn merged commit 3c13664 into develop Oct 25, 2013
@cmeiklejohn cmeiklejohn deleted the bugfix/csm/resolve-equality branch October 25, 2013 22:36
@russelldb
Copy link
Member

I don't understand this change…it looks like it might be expensive…why is it needed?

@russelldb
Copy link
Member

So, syntactic merge does the deep equals test already, since the thing returned from syntactic merge is either EXACTLY the object that went in, or it is changed I think the old =:= was correct.

@cmeiklejohn
Copy link
Contributor Author

screen shot 2013-10-25 at 11 42 09 am

Since we have lack of history here, I'll update what's happening.

The metadata dictionary is implemented as a tree structure, with changes structure based on insertion order of elements, so two objects with the same value can generate siblings when they are equal unless we perform the actual deep equality check of the objects. This is extremely problematic with a default of allow_mult=true.

This is most likely a huge performance hit in riak_kv, but produces correct behavior.

@evanmcc
Copy link
Contributor

evanmcc commented Oct 26, 2013

Note that I've seen the convo in Core/KV, so just following up on that + my
thoughts when reviewing:

I signed off on it without doing a lot of review of context because
although it might be expensive, I had a plan to rework this entire code
path for 2.0 (since syntactic merge is already so expensive) and I thought
that correctness was more important for the preview.

It's good to hear that there are other (potentially simpler) optimizations
incoming, though.

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.

4 participants