antidote icon indicating copy to clipboard operation
antidote copied to clipboard

Fix ordering issue in vector_orddict

Open define-null opened this issue 2 years ago • 1 comments

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.

define-null avatar Jun 15 '22 10:06 define-null

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.

bieniusa avatar Jun 20 '22 07:06 bieniusa