apache / incubator-pegasus

Apache Pegasus - A horizontally scalable, strongly consistent and high-performance key-value store
https://pegasus.apache.org/
Apache License 2.0
1.99k stars 312 forks source link

feat(fqdn): Limit the cache size on dns_resolve #1892

Open GehaFearless opened 9 months ago

GehaFearless commented 9 months ago

The cache of dns_resolve is unlimited, the cache size may be huge. Implement an expiration mechanism to limit the cache size and make it possible to update the resolve result.

acelyc111 commented 9 months ago

Good job! Consider to use a LRU cache, thers is an implementation exported from RocksDB, see https://github.com/facebook/rocksdb/blob/main/include/rocksdb/cache.h#L270