-
Notifications
You must be signed in to change notification settings - Fork 545
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hash object names used as cache keys for CachingBucket
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 a cryptographic hash of the object name when the hashed version of the name is shorter than the full name. This is the same approach taken for postings in the store-gateway `indexcache`. This has the added benefit of not invalidating most existing cache entries when rolling out this change. With the hash function picked, key generation is between 5 and 10 times slower than _not_ hashing the key but still dramatically faster than a network operation. Related #9386
- Loading branch information
1 parent
acda41c
commit e4de319
Showing
3 changed files
with
211 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.