Skip to content
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

dnsdist: Add a 'keepStaleData' option to the packet cache #7310

Merged
merged 1 commit into from Jan 18, 2019

Conversation

rgacogne
Copy link
Member

@rgacogne rgacogne commented Jan 3, 2019

Short description

This new option prevents expired entries from being expunged from the packet cache associated to a pool if all the backends in this pool are down, so we can keep serving stale data until at least one backend gets available again.

Closes #7239.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • 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)

Copy link
Contributor

@pieterlexis pieterlexis left a comment

Choose a reason for hiding this comment

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

No review done on the code, only on the docs :)

@@ -220,8 +220,63 @@ void setupLuaBindings(bool client)
#endif /* HAVE_EBPF */

/* PacketCache */
g_lua.writeFunction("newPacketCache", [](size_t maxEntries, boost::optional<uint32_t> maxTTL, boost::optional<uint32_t> minTTL, boost::optional<uint32_t> tempFailTTL, boost::optional<uint32_t> staleTTL, boost::optional<bool> dontAge, boost::optional<size_t> numberOfShards, boost::optional<bool> deferrableInsertLock, boost::optional<uint32_t> maxNegativeTTL, boost::optional<bool> ecsParsing) {
return std::make_shared<DNSDistPacketCache>(maxEntries, maxTTL ? *maxTTL : 86400, minTTL ? *minTTL : 0, tempFailTTL ? *tempFailTTL : 60, maxNegativeTTL ? *maxNegativeTTL : 3600, staleTTL ? *staleTTL : 60, dontAge ? *dontAge : false, numberOfShards ? *numberOfShards : 1, deferrableInsertLock ? *deferrableInsertLock : true, ecsParsing ? *ecsParsing : false);
g_lua.writeFunction("newPacketCache", [](size_t maxEntries, boost::optional<uint32_t> maxTTL, boost::optional<uint32_t> minTTL, boost::optional<uint32_t> tempFailTTL, boost::optional<uint32_t> staleTTL, boost::optional<bool> dontAge, boost::optional<size_t> numberOfShards, boost::optional<bool> deferrableInsertLock, boost::optional<uint32_t> maxNegativeTTL, boost::optional<bool> ecsParsing, boost::optional<std::unordered_map<std::string, boost::variant<bool, size_t>>> vars) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to keep this backwards compatible? I believe 1.4.0 will be the next version so we could just only accept an options table.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm actually not sure yet, so until a breaking change comes up I'm going to assume we will release a 1.3.4 first. Otherwise I'll have to change all the 1.3.4 to 1.4.0, and it will indeed be the time to break this as well :)

pdns/dnsdistdist/docs/reference/config.rst Outdated Show resolved Hide resolved
@pieterlexis pieterlexis merged commit 8850871 into PowerDNS:master Jan 18, 2019
@rgacogne rgacogne deleted the dnsdist-dont-expunge-stale branch January 18, 2019 10:05
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.

dnsdist: stop expunging entries from the cache if all servers are down
2 participants