2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 23:25:38 +00:00

new: usr: Implement the ForwardOnlyFail statistics channel counter

The new ForwardOnlyFail statistics channel counter indicates the
number of queries failed due to bad forwarders for 'forward only'
zones.

Related to #1793

Merge branch 'aram/add-new-stats-channel-counter-forwardonlyfail' into 'main'

See merge request isc-projects/bind9!9498
This commit is contained in:
Arаm Sаrgsyаn
2024-09-16 12:17:42 +00:00
5 changed files with 22 additions and 5 deletions

View File

@@ -472,6 +472,8 @@ init_desc(void) {
"ClientQuota"); "ClientQuota");
SET_RESSTATDESC(nextitem, "waited for next item", "NextItem"); SET_RESSTATDESC(nextitem, "waited for next item", "NextItem");
SET_RESSTATDESC(priming, "priming queries", "Priming"); SET_RESSTATDESC(priming, "priming queries", "Priming");
SET_RESSTATDESC(forwardonlyfail, "all forwarders failed",
"ForwardOnlyFail");
INSIST(i == dns_resstatscounter_max); INSIST(i == dns_resstatscounter_max);

View File

@@ -166,10 +166,11 @@ status=$((status + ret))
# GL#1793 # GL#1793
n=$((n + 1)) n=$((n + 1))
echo_i "checking that the 'serverquota' counter isn't increased because of the SERVFAIL in the previous check ($n)" echo_i "checking that the correct counter is increased because of the SERVFAIL in the previous check ($n)"
ret=0 ret=0
"${CURL}" "http://10.53.0.4:${EXTRAPORT1}/json/v1" 2>/dev/null >statschannel.out.$n "${CURL}" "http://10.53.0.4:${EXTRAPORT1}/json/v1" 2>/dev/null >statschannel.out.$n
grep -F "ServerQuota" statschannel.out.$n >/dev/null && ret=1 grep -F '"ServerQuota"' statschannel.out.$n >/dev/null && ret=1
grep -F '"ForwardOnlyFail":1' statschannel.out.$n >/dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret)) status=$((status + ret))

View File

@@ -8236,6 +8236,9 @@ Resolver Statistics Counters
``ClientQuota`` ``ClientQuota``
This indicates the number of queries spilled for exceeding the :any:`clients-per-query` quota. This indicates the number of queries spilled for exceeding the :any:`clients-per-query` quota.
``ForwardOnlyFail``
This indicates the number of queries failed due to bad forwarders for ``forward only`` zones.
``NextItem`` ``NextItem``
This indicates the number of times the server waited for the next item after receiving an invalid response. This indicates the number of times the server waited for the next item after receiving an invalid response.

View File

@@ -74,7 +74,8 @@ enum {
dns_resstatscounter_clientquota = 43, dns_resstatscounter_clientquota = 43,
dns_resstatscounter_nextitem = 44, dns_resstatscounter_nextitem = 44,
dns_resstatscounter_priming = 45, dns_resstatscounter_priming = 45,
dns_resstatscounter_max = 46, dns_resstatscounter_forwardonlyfail = 46,
dns_resstatscounter_max = 47,
/* /*
* DNSSEC stats. * DNSSEC stats.

View File

@@ -3715,13 +3715,23 @@ out:
/* /*
* If all of the addresses found were over the * If all of the addresses found were over the
* fetches-per-server quota, return the * fetches-per-server quota, increase the ServerQuota
* configured response. * counter and return the configured response.
*/ */
if (all_spilled) { if (all_spilled) {
result = res->quotaresp[dns_quotatype_server]; result = res->quotaresp[dns_quotatype_server];
inc_stats(res, dns_resstatscounter_serverquota); inc_stats(res, dns_resstatscounter_serverquota);
} }
/*
* If we are using a 'forward only' policy, and all
* the forwarders are bad, increase the ForwardOnlyFail
* counter.
*/
if (fctx->fwdpolicy == dns_fwdpolicy_only) {
inc_stats(res,
dns_resstatscounter_forwardonlyfail);
}
} }
} else { } else {
/* /*