From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Tue, 20 May 2025 14:51:03 +0000 (-0400) Subject: Fix spelling for `setWHashedPerturbation` X-Git-Tag: auth-5.0.0-alpha1~3^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=133b1c5430936714090ba0308310eb1c9a8051ca;p=thirdparty%2Fpdns.git Fix spelling for `setWHashedPerturbation` The goal is to deprecate the misspelled flavor while still supporting it. --- diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 763f852799..3bb5eeaf6a 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -1011,7 +1011,6 @@ Peeters Pels Penev Perroud -Pertubation Pfetzing pgmysql pgmysqlbackend diff --git a/.github/actions/spell-check/patterns.txt b/.github/actions/spell-check/patterns.txt index b154295b07..990b28c079 100644 --- a/.github/actions/spell-check/patterns.txt +++ b/.github/actions/spell-check/patterns.txt @@ -1,5 +1,8 @@ # See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns +# deprecated +setWHashedPertubation + \bcommit [0-9a-f]+\b # HMAC diff --git a/pdns/dnsdistdist/dnsdist-console.cc b/pdns/dnsdistdist/dnsdist-console.cc index d3542c1ec4..8459bb6754 100644 --- a/pdns/dnsdistdist/dnsdist-console.cc +++ b/pdns/dnsdistdist/dnsdist-console.cc @@ -793,7 +793,7 @@ static const std::vector s_consoleKeywords{ {"setVerboseLogDestination", true, "destination file", "Set a destination file to write the 'verbose' log messages to, instead of sending them to syslog and/or the standard output"}, {"setWebserverConfig", true, "[{password=string, apiKey=string, customHeaders, statsRequireAuthentication}]", "Updates webserver configuration"}, {"setWeightedBalancingFactor", true, "factor", "Set the balancing factor for bounded-load weighted policies (whashed, wrandom)"}, - {"setWHashedPertubation", true, "value", "Set the hash perturbation value to be used in the whashed policy instead of a random one, allowing to have consistent whashed results on different instance"}, + {"setWHashedPerturbation", true, "value", "Set the hash perturbation value to be used in the whashed policy instead of a random one, allowing to have consistent whashed results on different instance"}, {"show", true, "string", "outputs `string`"}, {"showACL", true, "", "show our ACL set"}, {"showBinds", true, "", "show listening addresses (frontends)"}, diff --git a/pdns/dnsdistdist/dnsdist-lua-configuration-items.cc b/pdns/dnsdistdist/dnsdist-lua-configuration-items.cc index 546f027b20..e482d4767a 100644 --- a/pdns/dnsdistdist/dnsdist-lua-configuration-items.cc +++ b/pdns/dnsdistdist/dnsdist-lua-configuration-items.cc @@ -142,7 +142,8 @@ static const std::map s {"setDoHDownstreamMaxIdleTime", {[](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_outgoingDoHMaxIdleTime = newValue; }, std::numeric_limits::max()}}, #endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ {"setMaxUDPOutstanding", {[](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_maxUDPOutstanding = newValue; }, std::numeric_limits::max()}}, - {"setWHashedPertubation", {[](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_hashPerturbation = newValue; }, std::numeric_limits::max()}}, + {"setWHashedPertubation" /* Deprecated */, {[](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_hashPerturbation = newValue; }, std::numeric_limits::max()}}, + {"setWHashedPerturbation", {[](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_hashPerturbation = newValue; }, std::numeric_limits::max()}}, #ifndef DISABLE_RECVMMSG {"setUDPMultipleMessagesVectorSize", {[](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_udpVectorSize = newValue; }, std::numeric_limits::max()}}, #endif /* DISABLE_RECVMMSG */ diff --git a/pdns/dnsdistdist/dnsdist-settings-definitions.yml b/pdns/dnsdistdist/dnsdist-settings-definitions.yml index 00267d885d..2f6de6f2d1 100644 --- a/pdns/dnsdistdist/dnsdist-settings-definitions.yml +++ b/pdns/dnsdistdist/dnsdist-settings-definitions.yml @@ -2090,7 +2090,7 @@ load_balancing_policies: - name: "hash_perturbation" type: "u32" default: "0" - lua-name: "setWHashedPertubation" + lua-name: "setWHashedPerturbation" internal-field-name: "d_hashPerturbation" runtime-configurable: false description: "Set the hash perturbation value to be used in the ``whashed`` policy instead of a random one, allowing to have consistent ``whashed`` results on different instances" diff --git a/pdns/dnsdistdist/docs/guides/serverselection.rst b/pdns/dnsdistdist/docs/guides/serverselection.rst index 25223f48a4..13c8f659b0 100644 --- a/pdns/dnsdistdist/docs/guides/serverselection.rst +++ b/pdns/dnsdistdist/docs/guides/serverselection.rst @@ -45,7 +45,7 @@ For example, if we have two servers, with respective weights of 1 and 4, we expe ``whashed`` is a similar weighted policy, but assigns questions with identical hash to identical servers, allowing for better cache concentration ('sticky queries'). The current hash algorithm is based on the qname of the query. -.. function:: setWHashedPertubation(value) +.. function:: setWHashedPerturbation(value) Set the hash perturbation value to be used in the whashed policy instead of a random one, allowing to have consistent whashed results on different instances. @@ -63,7 +63,7 @@ For example, if we have two servers, with respective weights of 1 and 4, we expe Increasing the weight of servers to a value larger than the default is required to get a good distribution of queries. Small values like 100 or 1000 should be enough to get a correct distribution. This is a side-effect of the internal implementation of the consistent hashing algorithm, which assigns as many points on a circle to a server than its weight, and distributes a query to the server who has the closest point on the circle from the hash of the query's qname. Therefore having very few points, as is the case with the default weight of 1, leads to a poor distribution of queries. -You can also set the hash perturbation value, see :func:`setWHashedPertubation`. To achieve consistent distribution over :program:`dnsdist` restarts, you will also need to explicitly set the backend's UUIDs with the ``id`` option of :func:`newServer`. You can get the current UUIDs of your backends by calling :func:`showServers` with the ``showUUIDs=true`` option. +You can also set the hash perturbation value, see :func:`setWHashedPerturbation`. To achieve consistent distribution over :program:`dnsdist` restarts, you will also need to explicitly set the backend's UUIDs with the ``id`` option of :func:`newServer`. You can get the current UUIDs of your backends by calling :func:`showServers` with the ``showUUIDs=true`` option. Since 1.5.0, a bounded-load version is also supported, preventing one server from receiving much more queries than intended, even if the distribution of queries is not perfect. This "consistent hashing with bounded loads" algorithm is enabled by setting :func:`setConsistentHashingBalancingFactor` to a value other than 0, which is the default. This value is the maximum number of outstanding queries that a given server can have at a given time, as a ratio of the total number of outstanding queries for all the active servers in the pool, pondered by the weight of the server.