]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #12374 from omoerbeek/rec-cache-clean
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 6 Jan 2023 13:29:45 +0000 (14:29 +0100)
committerGitHub <noreply@github.com>
Fri, 6 Jan 2023 13:29:45 +0000 (14:29 +0100)
Rec: make cache cleaning more fair when under pressure

1  2 
pdns/recursordist/negcache.cc
pdns/recursordist/negcache.hh
pdns/recursordist/rec-main.cc

Simple merge
index 4e4264cee4d7105072070294fa30f3cebcbe98c9,01a4e402b665a3ecb6e7362220fe787be56d65e0..4e4648aa48890bc2dcf7c2bca9176041d2472ab9
@@@ -87,14 -87,14 +87,14 @@@ public
    };
  
    void add(const NegCacheEntry& ne);
 -  void updateValidationStatus(const DNSName& qname, const QType& qtype, const vState newState, boost::optional<time_t> capTTD);
 -  bool get(const DNSName& qname, const QType& qtype, const struct timeval& now, NegCacheEntry& ne, bool typeMustMatch = false, bool serverStale = false, bool refresh = false);
 +  void updateValidationStatus(const DNSName& qname, QType qtype, vState newState, boost::optional<time_t> capTTD);
 +  bool get(const DNSName& qname, QType qtype, const struct timeval& now, NegCacheEntry& ne, bool typeMustMatch = false, bool serverStale = false, bool refresh = false);
    bool getRootNXTrust(const DNSName& qname, const struct timeval& now, NegCacheEntry& ne, bool serveStale, bool refresh);
    size_t count(const DNSName& qname);
 -  size_t count(const DNSName& qname, const QType qtype);
 +  size_t count(const DNSName& qname, QType qtype);
    void prune(size_t maxEntries);
    void clear();
-   size_t dumpToFile(FILE* fd, const struct timeval& now);
+   size_t doDump(int fd, size_t maxCacheEntries);
    size_t wipe(const DNSName& name, bool subtree = false);
    size_t size() const;
  
Simple merge