]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Address PR review comments
authorOliver Chen <oliver.chen@nokia-sbell.com>
Sat, 14 Jun 2025 13:18:58 +0000 (13:18 +0000)
committerOliver Chen <oliver.chen@nokia-sbell.com>
Sat, 14 Jun 2025 13:18:58 +0000 (13:18 +0000)
pdns/dnsdistdist/dnsdist-lbpolicies.cc
pdns/dnsdistdist/dnsdist-settings-definitions.yml
pdns/dnsdistdist/docs/guides/serverselection.rst
pdns/dnsdistdist/docs/reference/yaml-settings.rst

index 97d51e7c5a6048643a51bcbaea4f7c417464b48e..343cdf19334676ea65688de1efc842538207b81e 100644 (file)
@@ -276,7 +276,7 @@ shared_ptr<DownstreamState> orderedWrandUntag(const ServerPolicy::NumberedServer
     if (svr.second->isUp() && svr.second->d_config.order <= curOrder && (!dnsq->ids.qTag || dnsq->ids.qTag->count(svr.second->getNameWithAddr()) == 0)) {
       if (svr.second->d_config.order < curOrder) {
           curOrder = svr.second->d_config.order;
-          startIndex = candidates.end() - candidates.begin();
+          startIndex = candidates.size();
           curNumber = 1;
       }
       candidates.push_back(ServerPolicy::NumberedServer(curNumber++, svr.second));
index fe3faad27e82ce62ccccadc32008dc1a03dae35e..04a1b13ef224814243b10c8295a7304e13d0a2f4 100644 (file)
@@ -2079,7 +2079,7 @@ load_balancing_policies:
       lua-name: "setWeightedBalancingFactor"
       internal-field-name: "d_weightedBalancingFactor"
       runtime-configurable: false
-      description: "Set the maximum imbalance between the number of outstanding queries intended for a given server, based on its weight, and the actual number, when using the ``whashed`` or ``wrandom`` or ``orderedWrandUntag`` load-balancing policy. Default is 0, which disables the bounded-load algorithm"
+      description: "Set the maximum imbalance between the number of outstanding queries intended for a given server, based on its weight, and the actual number, when using the ``whashed``, ``wrandom`` or ``orderedWrandUntag`` load-balancing policy. Default is 0, which disables the bounded-load algorithm"
     - name: "consistent_hashing_balancing_factor"
       type: "f64"
       default: 0.0
index c7f1112cefb4aed73a0ba7ac0f12dacd01a49b98..b562d78c063ab8b14679967aeb528c5395703e21 100644 (file)
@@ -91,7 +91,7 @@ If all servers are down, the policy will still select one server by default. Set
 ``orderedWrandUntag`` is another weighted policy with additional server filtering:
 
 - select the group of server(s) with the lowest ``order`` passed to :func:`newServer`.
-- filter out server(s) that were tagged with key string of :func:`Server:getNameWithAddr` in the query that was set by :func:`DNSQuestion:setTag`. This can be useful to restart a query with a different server, the user is responsible to set the required tag in lua action before calling :func:`DNSResponse:restart`. Initial queries are not impacted by this filtering if no other intentional lua action to set the tag.
+- filter out server(s) that were tagged with key string of :func:`Server:getNameWithAddr` in the query that was set by :func:`DNSQuestion:setTag`. This can be useful to restart a query with a different server, the user is responsible to set the required tag in lua action before calling :func:`DNSResponse:restart`. Initial queries are not impacted by this filtering if there is no other intentional lua action to set the tag.
 - policy ``wrandom`` is then applied to the selected server(s) above.
 
 Lua server policies
@@ -309,7 +309,7 @@ Functions
   .. versionadded: 1.5.0
 
   Set the maximum imbalance between the number of outstanding queries intended for a given server, based on its weight,
-  and the actual number, when using the ``whashed`` or ``wrandom`` or ``orderedWrandUntag`` load-balancing policy.
+  and the actual number, when using the ``whashed``, ``wrandom`` or ``orderedWrandUntag`` load-balancing policy.
   Default is 0, which disables the bounded-load algorithm.
 
 .. function:: showPoolServerPolicy(pool)
index 58dc8bf1b588b19b2d3058819b043fe8a3db0cec..cc7be9f6a975445d2345d404903992c19ae8e666 100644 (file)
@@ -631,7 +631,7 @@ Setting for load-balancing policies
 - **default_policy**: String ``(leastOutstanding)`` - Set the default server selection policy
 - **servfail_on_no_server**: Boolean ``(false)`` - If set, return a ServFail when no servers are available, instead of the default behaviour of dropping the query
 - **round_robin_servfail_on_no_server**: Boolean ``(false)`` - By default the roundrobin load-balancing policy will still try to select a backend even if all backends are currently down. Setting this to true will make the policy fail and return that no server is available instead
-- **weighted_balancing_factor**: Double ``(0.0)`` - Set the maximum imbalance between the number of outstanding queries intended for a given server, based on its weight, and the actual number, when using the ``whashed`` or ``wrandom`` or ``orderedWrandUntag`` load-balancing policy. Default is 0, which disables the bounded-load algorithm
+- **weighted_balancing_factor**: Double ``(0.0)`` - Set the maximum imbalance between the number of outstanding queries intended for a given server, based on its weight, and the actual number, when using the ``whashed``, ``wrandom`` or ``orderedWrandUntag`` load-balancing policy. Default is 0, which disables the bounded-load algorithm
 - **consistent_hashing_balancing_factor**: Double ``(0.0)`` - Set the maximum imbalance between the number of outstanding queries intended for a given server, based on its weight, and the actual number, when using the ``chashed`` consistent hashing load-balancing policy. Default is 0, which disables the bounded-load algorithm
 - **custom_policies**: Sequence of :ref:`CustomLoadBalancingPolicyConfiguration <yaml-settings-CustomLoadBalancingPolicyConfiguration>` - Custom load-balancing policies implemented in Lua
 - **hash_perturbation**: Unsigned integer ``(0)`` - 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