[SERVER-82618] Replace usages of absl::hash_internal Created: 31/Oct/23  Updated: 28/Nov/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Ivan Fefer Assignee: Backlog - Storage Execution Team
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-77698 Replace MurmurHash3 with absl::Hash i... Blocked
Related
related to SERVER-83522 absl::hash doesn't guarantee hashing ... Closed
Assigned Teams:
Storage Execution
Participants:

 Description   

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 internalimpltestdetailbenchmarksample, 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:

  1. We can use WiredTiger's implementation
  2. We can vendor CityHash separately (I am not sure if this is the best repo for it)
  3. We can consider switching to more modern hash function, like xxHash that uses SIMD.


 Comments   
Comment by Chris Hutchinson [ 17/Nov/23 ]

Given there are call sites in key string and lock manager, we are passing this to storage execution

Generated at Thu Feb 08 06:49:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.