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

Fix ordering issue in vector_orddict #488

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

define-null
Copy link
Contributor

@define-null define-null commented Jun 15, 2022

In the current master vector_orddict:insert function would compare all dots for >, rather then >=, which will lead to a wrong ordering of vv, such that: if given
#{dc1 => 1, dc2 => 1} and #{dc1 => 1, dc=> 2}, the vector_orddict internal ordering would be dependent on the insert order, and vector_orddict:first would give different results. It also may lead to vv being ordered in monotonically increasing order rather then decreasing, at the doc says.

@bieniusa
Copy link
Contributor

Thanks for spotting the issue!
It seems that the function is not used, so this wasn't creating any problem.
The actually used insert_bigger employs vectorclock:le\2 so this should be correct.

I suggest removing all_dots_greater and all_dots_smaller as they are not used anywhere and the generic all_dots is more useful and less ambiguous, might also consider removing the unused functions from vector_orddict.

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