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

Projects
None yet
2 participants
@rgacogne
Copy link
Member

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)

@rgacogne rgacogne added this to the dnsdist-1.3.x milestone Jan 3, 2019

@pieterlexis
Copy link
Member

left a comment

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) {

This comment has been minimized.

Copy link
@pieterlexis

pieterlexis Jan 3, 2019

Member

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.

This comment has been minimized.

Copy link
@rgacogne

rgacogne Jan 3, 2019

Author Member

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 :)

Show resolved Hide resolved pdns/dnsdistdist/docs/reference/config.rst Outdated

@rgacogne rgacogne force-pushed the rgacogne:dnsdist-dont-expunge-stale branch from ff150f7 to e780997 Jan 3, 2019

@rgacogne rgacogne force-pushed the rgacogne:dnsdist-dont-expunge-stale branch from e780997 to c1b8138 Jan 10, 2019

@pieterlexis pieterlexis merged commit 8850871 into PowerDNS:master Jan 18, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@rgacogne rgacogne deleted the rgacogne:dnsdist-dont-expunge-stale branch Jan 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.