Skip to content

Fix ordering issue in vector_orddict#488

Open
define-null wants to merge 2 commits intoAntidoteDB:masterfrom
define-null:defnull/fix-vector-orddict-ordering
Open

Fix ordering issue in vector_orddict#488
define-null wants to merge 2 commits intoAntidoteDB:masterfrom
define-null:defnull/fix-vector-orddict-ordering

Conversation

@define-null
Copy link
Copy Markdown
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
Copy Markdown
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.

2 participants