Skip to content

Conversation

martinsumner
Copy link

Resolve OpenRiak/riak_kv#32.

Reviewed in martinsumner#124.

This PR stops treating a hash of 0 as a special case, the special case is now refereed to as none so that clocks that has to 0 are handled as with any other hash.

* Handle VCs that hash to 0

Because of a mistake (perhaps because phash/1 hashed to a range starting at 1, and phash2/1 now starts at 0) - special meaning was attributed to a hash of 0, which would means that updating hashtrees would not be handled correctly if the actual clock had a hash collision with 0.

Special meaning now uses `none` not 0 - and 0 is handled as with any other hash value.

* Add support for CH, OH of none, none

Used in rehash in riak_kv_vnode - expected to be a neutral change i.e. CH, CH

* Update comment

* Clarify comments/types

* Update GHA and workflow

* Update erlang.yml
@martinsumner martinsumner merged commit 5308a82 into openriak-3.2 Mar 19, 2025
1 check passed
@martinsumner martinsumner deleted the nhse-o32-upstream.d31 branch March 19, 2025 15:17
martinsumner added a commit that referenced this pull request Mar 19, 2025
* Handle VCs that hash to 0 (martinsumner#123)

* Handle VCs that hash to 0

Because of a mistake (perhaps because phash/1 hashed to a range starting at 1, and phash2/1 now starts at 0) - special meaning was attributed to a hash of 0, which would means that updating hashtrees would not be handled correctly if the actual clock had a hash collision with 0.

Special meaning now uses `none` not 0 - and 0 is handled as with any other hash value.

* Add support for CH, OH of none, none

Used in rehash in riak_kv_vnode - expected to be a neutral change i.e. CH, CH

* Update comment

* Clarify comments/types

* Update GHA and workflow

* Update erlang.yml

* Update mockvnode_SUITE.erl
martinsumner added a commit that referenced this pull request Mar 20, 2025
* Nhse o32 upstream.d31 (#5)

* Handle VCs that hash to 0 (martinsumner#123)

* Handle VCs that hash to 0

Because of a mistake (perhaps because phash/1 hashed to a range starting at 1, and phash2/1 now starts at 0) - special meaning was attributed to a hash of 0, which would means that updating hashtrees would not be handled correctly if the actual clock had a hash collision with 0.

Special meaning now uses `none` not 0 - and 0 is handled as with any other hash value.

* Add support for CH, OH of none, none

Used in rehash in riak_kv_vnode - expected to be a neutral change i.e. CH, CH

* Update comment

* Clarify comments/types

* Update GHA and workflow

* Update erlang.yml

* Update mockvnode_SUITE.erl

* Add back OTP 26 testing
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.

Hash collision on 0 when hashing vclocks for tictac AAE
1 participant