-
Notifications
You must be signed in to change notification settings - Fork 353
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
feat(pageserver): use fnv hash for aux file encoding #7742
Conversation
Signed-off-by: Alex Chi Z <chi@neon.tech>
3060 tests run: 2933 passed, 0 failed, 127 skipped (full report)Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
c5f03a8 at 2024-05-14T15:46:38.218Z :recycle: |
128 bit and other length variants exist, see https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function. That particular crate only implements the 64 bit variant but there are others, and it's not hard to roll your own. I'd assume 64 bits to be enough, though. |
Do we need to worry about malicious actors creating intentional collisions here? What happens if there's a ton of collisions? Does it only cause trouble for the single tenant, or the whole pageserver? |
switched to FNV128 using the prime + offset in the wiki, better to get a review again, or I'll merge it later today. |
Signed-off-by: Alex Chi Z <chi@neon.tech>
Okay it still requires a review from code owner 🤣 @koivunej do you have time to take a look? Thanks :) |
Creating intentional collision might cause write amplifications like before John’s one-file-one-delta-record PR, and it will only cause trouble for a single tenant. We can change the encoding of aux file value to delta + image in the future if it indeed becomes a problem. |
Problem
FNV hash is simple, portable, and stable. This pull request vendors the FNV hash implementation from servo and modified it to use the u128 variant.
replaces #7644
ref #7462
Summary of changes
Checklist before requesting a review
Checklist before merging