-
Notifications
You must be signed in to change notification settings - Fork 535
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
Hash object names used as cache keys for CachingBucket #9968
base: main
Are you sure you want to change the base?
Conversation
a6db65e
to
29c831a
Compare
29c831a
to
fdaf626
Compare
Benchmarks! Hashing when building keys is obviously much slower than not doing that but in absolute numbers, still pretty fast compared to the network operations we'll be doing:
|
When caching rule groups, the base64 encoded name of the rule group is used as part of the key for caching its contents. For long rule group names, this can exceed the max key length of Memcached. To solve this we use the sha256 of the object name in the cache key instead of the object name itself. Related #9386
Signed-off-by: Nick Pillitteri <[email protected]>
1032ef9
to
ac7d058
Compare
That's not blocking I'm curious if you considered |
I missed that, thank you! I'll take a look at this and post some new benchmarks |
What this PR does
When caching rule groups, the base64 encoded name of the rule group is used as part of the key for caching its contents. For long rule group names, this can exceed the max key length of Memcached. To solve this we use the sha256 of the object name in the cache key instead of the object name itself.
Which issue(s) this PR fixes or relates to
Related #9386
Notes for reviewers
We're using a SHA3 hash for this since we don't want collisions and I didn't want to use the approach we take in the query-frontend: storing a "results" object with a key to disambiguate collisions. I
haven't run benchmarks but Idid take care to make sure that we're only doing a single hash per object storage operation.Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.