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

maint: Remove use of folly/hash/Hash.h #1506

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

Conversation

ianthomas23
Copy link
Collaborator

Reference Issues/PRs

Fixes the 5th item of the folly replacement plan, issue #1412.

What does this implement or fix?

This removes the single include of folly/hash/Hash.h. The only explicit use of this is folly::hash::hash_combine which I have replaced with use of boost::hash_combine.

It would alternatively be possible to vendor the 3 or so folly functions, but I have rejected this idea. One of the functions is hash_128_to_64 and is taken from cityhash which is essentially unmaintained for 11 years. I would rather use the actively maintained boost.

Any other comments?

There are some tests of folly::hash::commutative_hash_combine in test_hash.cpp, but this function is not used anywhere else in the ArcticDB code base so I have removed the test code as not being relevant.

Signed-off-by: Ian Thomas <ianthomas23@gmail.com>
@ianthomas23 ianthomas23 mentioned this pull request Apr 18, 2024
17 tasks
Comment on lines +105 to +112
auto seed = hash(id_);
boost::hash_combine(seed, version_id_);
boost::hash_combine(seed, creation_ts_);
boost::hash_combine(seed, content_hash_);
boost::hash_combine(seed, key_type_);
boost::hash_combine(seed, index_start_);
boost::hash_combine(seed, index_end_);
hash_ = seed;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the returned values of get_cached_hash must not change for backward compatibility (e.g. to be able to retrieve segments which have been stored in databases in previous versions).

Is there a way we could test that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's the case, however I agree we should check. I believe we have version backwards and forwards compatibility checks, I'll find out where they are and point you at them

@jjerphan jjerphan changed the title [maint]: Remove use of folly/hash/Hash.h maint: Remove use of folly/hash/Hash.h May 20, 2024
Copy link
Collaborator

@jjerphan jjerphan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

The backwards and forwards compatibility checks are performed by .github/workflows/persistent_storage.yml.

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

3 participants