-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Storage Execution
In some places where we want a modern hash, we use CityHash.
The implementation we use is lifted from absl::hash_internal::CityHash and we use it in several places:
https://github.com/search?q=repo%3Amongodb%2Fmongo%20absl%3A%3Ahash_internal&type=code
abseil explicitly ask users not to depend on anything with the word internal in it: https://abseil.io/about/compatibility#c-symbols-and-files
- Do not depend upon internal details. If something is in a namespace, file, directory, or simply contains the string internal, impl, test, detail, benchmark, sample, or example, unless it is explicitly called out, it is not part of the public API. It’s an implementation detail. You cannot friend it, you cannot include it, you cannot mention it or refer to it in any way.
This may complicate stuff when we upgrade absl version and CityHash is replaced with some other hash function.
If we want to use it, we have several options:
- We can use WiredTiger's implementation
- We can vendor CityHash separately (I am not sure if this is the best repo for it)
- We can consider switching to more modern hash function, like xxHash that uses SIMD.
- is depended on by
-
SERVER-77698 Replace MurmurHash3 with absl::Hash if possible in SimpleStringDataComparator::hash_combine
- Blocked
- related to
-
SERVER-83522 absl::hash doesn't guarantee hashing values of different C++ types the same but we rely on that in SBE
- Closed