Skip to content

rec: keep cache warm for a list of names#17360

Draft
omoerbeek wants to merge 11 commits into
PowerDNS:masterfrom
omoerbeek:rec-warmcache
Draft

rec: keep cache warm for a list of names#17360
omoerbeek wants to merge 11 commits into
PowerDNS:masterfrom
omoerbeek:rec-warmcache

Conversation

@omoerbeek
Copy link
Copy Markdown
Member

Short description

This is different from refresh-on-ttl-perc as it does not require a name/qtype to be queried to kick the refresh.

List is a keepwarm key in the recordcache section. Value is a list, for example:

recordcache:
  keepwarm:
    - qname: google.com
    - qname: microsoft.com

If you have lots of names in the list you'll see taskqueue-expired grow and taskqueue-size never hitting zero. In that case increase the new recursor.taskthreads setting.

Draft as tests and docs are missing.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • read and accepted the Developer Certificate of Origin document, including the AI Policy, and added a "Signed-off-by" to my commits
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

omoerbeek added 11 commits May 13, 2026 13:24
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
…half the TTL has passed

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
log->error(Logr::Warning, e.reason, msg, "exception", Logging::Loggable("ImmediateServFailException"));
ret.clear();
}
catch (const PolicyHitException& e) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
catch (const PolicyHitException& e) {
catch (const PolicyHitException&) {

bool haveAnswerRecord = false;
for (const auto& record : ret) {
if (record.d_place == DNSResourceRecord::ANSWER) {
haveAnswerRecord = true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tab crept in?


static std::atomic<uint32_t> s_counter;

// Use primes, it avoid not being scheduled in cases where the counter has a regular pattern.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Use primes, it avoid not being scheduled in cases where the counter has a regular pattern.
// Use primes, they avoid not being scheduled in cases where the counter shows a regular pattern.

@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 25805322127

Coverage decreased (-2.9%) to 68.18%

Details

  • Coverage decreased (-2.9%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 2059 coverage regressions across 60 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

2059 previously-covered lines in 60 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
pdns/gss_context.cc 346 0.0%
pdns/protozero-trace.cc 328 12.87%
pdns/webserver.cc 201 55.72%
pdns/ixfr.cc 118 25.16%
pdns/protozero-trace.hh 114 35.67%
pdns/dnssecinfra.cc 79 65.42%
pdns/dnsrecords.hh 73 53.23%
pdns/shuffle.cc 65 0.0%
pdns/misc.cc 52 58.08%
pdns/arguments.cc 45 52.24%

Coverage Stats

Coverage Status
Relevant Lines: 120775
Covered Lines: 90071
Line Coverage: 74.58%
Relevant Branches: 54306
Covered Branches: 29299
Branch Coverage: 53.95%
Branches in Coverage %: Yes
Coverage Strength: 7356548.67 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants