-
Notifications
You must be signed in to change notification settings - Fork 65
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(PE-6695/PE-6696): remove resolver, add redis support for arns cache #200
Commits on Sep 9, 2024
-
feat(arns): remove resolver, add redis support for arns cache
With on-demand resolution, we no longer need to support the arns-resolver. We can effectively fetch and cache arns resolutions quickly via AO and cache them locally or in redis. This replaces the default `MemoryArNSCache` with a configurable KvBufferStore that supports `redis` or a local `node-cache`. When resolving an arns name, the `CompositeArNSResolver` will check the provided cache and the TTL of the record, if it is not in the cache it will then use the available arns resolvers (on-demand and/or another gateway) to get resolution data. If an operator would like to disable caching of arns names, and always resolve to the latest they can set ARNS_CACHE_TTL_SECONDS to 0. Additionally, prometheus metrics are available for hit/miss rate for the arns cache and total resolution times.
dtfiedler committedSep 9, 2024 Configuration menu - View commit details
-
Copy full SHA for 037417e - Browse repository at this point
Copy the full SHA 037417eView commit details -
chore(kv): create abstract
KvArnsStore
to handle the hashing keys f……or arns in cache This is to avoid doing it in the composite resolver
dtfiedler committedSep 9, 2024 Configuration menu - View commit details
-
Copy full SHA for 3b09c9e - Browse repository at this point
Copy the full SHA 3b09c9eView commit details -
chore(arns): remove standalone and memory cache resolvers
dtfiedler committedSep 9, 2024 Configuration menu - View commit details
-
Copy full SHA for ecb7574 - Browse repository at this point
Copy the full SHA ecb7574View commit details -
chore(prom): update arns resolution time metric name
dtfiedler committedSep 9, 2024 Configuration menu - View commit details
-
Copy full SHA for 379e027 - Browse repository at this point
Copy the full SHA 379e027View commit details -
chore(logs): add url to redis kv store
dtfiedler committedSep 9, 2024 Configuration menu - View commit details
-
Copy full SHA for 0041495 - Browse repository at this point
Copy the full SHA 0041495View commit details
Commits on Sep 10, 2024
-
fix(arns): remove await to cache, fix config var to resolver
dtfiedler committedSep 10, 2024 Configuration menu - View commit details
-
Copy full SHA for f1bd0cf - Browse repository at this point
Copy the full SHA f1bd0cfView commit details -
feat(arns): add a promise cache for arns middleware
This protects against multiple calls to `nameResolver.resolver(name)` while resolving a single name. The cache is given a short TTL and requests are removed after they are resolved. The best way to verify this behavior is trigger concurrent requests to resolve an arns name (e.g. using `hey`) and observing the logs to resolve the name only appear once for all the requests. Once the original promise is resolved, every outstanding request is resolved with the result and the name & promise are removed from the request cache.
dtfiedler committedSep 10, 2024 Configuration menu - View commit details
-
Copy full SHA for d114821 - Browse repository at this point
Copy the full SHA d114821View commit details -
feat(arns): add circuit breaker for calling the IO network process
This should help avoid slamming AO when there are intermittent issues
Configuration menu - View commit details
-
Copy full SHA for 410cb5f - Browse repository at this point
Copy the full SHA 410cb5fView commit details -
Configuration menu - View commit details
-
Copy full SHA for b8afa1c - Browse repository at this point
Copy the full SHA b8afa1cView commit details -
fix(arns): returned cached resolution data if failed to fetch from re…
…solvers If we have the resolution in the cache, and we fail to fetch new data from the resolvers, returned the cached resolution data. This data will expire based on the the ARNS_CACHE_TTL_SECONDS config variable.
dtfiedler committedSep 10, 2024 Configuration menu - View commit details
-
Copy full SHA for b9e4fe6 - Browse repository at this point
Copy the full SHA b9e4fe6View commit details