-
Notifications
You must be signed in to change notification settings - Fork 233
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
Fix merge to properly operate over dict. #723
Conversation
Note: not the most efficient implementation that most likely exists. For this initial PR I was mainly focusing on ensuring I had the semantics of the merge correctly to start a discussion. Ensure we convert the inner dict to a list, uniquely sort the list, so we can uniquely merge both contents, and then map over the results to convert the inner list back to a dict. This is necessary because mutators add data to this dictionary and we can not guarantee an internal sort order, which causes siblings with a default of allow_mult=true for the same value. This is a side effect of the inner data structure not being an orddict.
Looks correct to me. Did you have a test (riak_test) that provoked this round of changes I can run to verify this does what you want it to? |
Right above, PR basho/riak_test#445 on verify_backup_restore. |
@evanmcc Any thoughts here? |
This looks fine to me if it fixed the problem. I'll do my best to address efficiency concerns in the near future, but we should always favor correctness over speed. |
Cool; I'd love if someone could verify the test passes for them before I merge it. Can either you or @russelldb take that? |
Doing it now |
Test fails for me. Clean riak_test checkout, clean riak checkout with riak_kv set to this branch.
================================================================================ |
Sorry, late here, will look again tomorrow. |
It's not finding the search files. You should be able to go into that directory /Users/russell/basho/riak_test/search-corpus/ and untar the spam.0.tgz file I think. |
Did that, same error. |
Make sure your .riak_test.config is pointing to the directory where the search_corpus is. This is unrelated to this fix. |
Ah! Thank you. Never had that problem before. Addressed that. Test does indeed now pass. +1 (sorry for the futzing) |
Fix merge to properly operate over dict.
Note: not the most efficient implementation that most likely exists.
For this initial PR I was mainly focusing on ensuring I had the
semantics of the merge correctly to start a discussion.
Ensure we convert the inner dict to a list, uniquely sort the list, so
we can uniquely merge both contents, and then map over the results to
convert the inner list back to a dict.
This is necessary because mutators add data to this dictionary and we
can not guarantee an internal sort order, which causes siblings with a
default of allow_mult=true for the same value.
This is a side effect of the inner data structure not being an orddict.
@evanmcc @engelsanchez