2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

Merge branch '2742-serve-stale-is-confusing' into 'main'

Update rndc serve-stale status output

Closes #2742

See merge request isc-projects/bind9!5521
This commit is contained in:
Matthijs Mekking 2021-10-25 09:26:33 +00:00
commit 8c1fc49974
6 changed files with 59 additions and 41 deletions

View File

@ -1,3 +1,6 @@
5747. [func] Update rndc serve-stale status output to be less
confusing. [GL #2742]
5746. [bug] A lame server delegation could lead to a loop in which
a resolver fetch depends on an ADB find which depends
on the same resolver fetch. Previously, this would

View File

@ -16513,21 +16513,35 @@ named_server_servestale(named_server_t *server, isc_lex_t *lex,
switch (view->staleanswersok) {
case dns_stale_answer_yes:
if (stale_ttl > 0) {
CHECK(putstr(text, "on (rndc)"));
CHECK(putstr(text, "stale cache enabled; stale "
"answers enabled"));
} else {
CHECK(putstr(text, "off (not-cached)"));
CHECK(putstr(text,
"stale cache disabled; stale "
"answers unavailable"));
}
break;
case dns_stale_answer_no:
CHECK(putstr(text, "off (rndc)"));
if (stale_ttl > 0) {
CHECK(putstr(text, "stale cache enabled; stale "
"answers disabled"));
} else {
CHECK(putstr(text,
"stale cache disabled; stale "
"answers unavailable"));
}
break;
case dns_stale_answer_conf:
if (view->staleanswersenable && stale_ttl > 0) {
CHECK(putstr(text, "on"));
} else if (view->staleanswersenable) {
CHECK(putstr(text, "off (not-cached)"));
CHECK(putstr(text, "stale cache enabled; stale "
"answers enabled"));
} else if (stale_ttl > 0) {
CHECK(putstr(text, "stale cache enabled; stale "
"answers disabled"));
} else {
CHECK(putstr(text, "off"));
CHECK(putstr(text,
"stale cache disabled; stale "
"answers unavailable"));
}
break;
}

View File

@ -416,17 +416,15 @@ Currently supported commands are:
See also ``rndc managed-keys``.
``serve-stale`` (**on** | **off** | **reset** | **status**) [*class* [*view*]]
This command enables, disables, resets, or reports the current status of the serving
of stale answers as configured in ``named.conf``.
This command enables, disables, resets, or reports the current status of
the serving of stale answers as configured in ``named.conf``.
If serving of stale answers is disabled by ``rndc-serve-stale off``,
then it remains disabled even if ``named`` is reloaded or
reconfigured. ``rndc serve-stale reset`` restores the setting as
configured in ``named.conf``.
If serving of stale answers is disabled by ``rndc-serve-stale off``, then it
remains disabled even if ``named`` is reloaded or reconfigured. ``rndc
serve-stale reset`` restores the setting as configured in ``named.conf``.
``rndc serve-stale status`` reports whether serving of stale
answers is currently enabled, disabled by the configuration, or
disabled by ``rndc``. It also reports the values of
``rndc serve-stale status`` reports whether caching and serving of stale
answers is currently enabled or disabled. It also reports the values of
``stale-answer-ttl`` and ``max-stale-ttl``.
``showzone`` *zone* [*class* [*view*]]

View File

@ -100,7 +100,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: on (stale-answer-ttl=4 max-stale-ttl=3600 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
grep '_default: stale cache enabled; stale answers enabled (stale-answer-ttl=4 max-stale-ttl=3600 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@ -207,7 +207,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: on (stale-answer-ttl=4 max-stale-ttl=3600 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
grep '_default: stale cache enabled; stale answers enabled (stale-answer-ttl=4 max-stale-ttl=3600 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@ -274,7 +274,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: off (rndc) (stale-answer-ttl=4 max-stale-ttl=3600 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
grep '_default: stale cache enabled; stale answers disabled (stale-answer-ttl=4 max-stale-ttl=3600 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@ -328,7 +328,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: on (rndc) (stale-answer-ttl=4 max-stale-ttl=3600 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
grep '_default: stale cache enabled; stale answers enabled (stale-answer-ttl=4 max-stale-ttl=3600 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@ -394,7 +394,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: on (stale-answer-ttl=4 max-stale-ttl=3600 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
grep '_default: stale cache enabled; stale answers enabled (stale-answer-ttl=4 max-stale-ttl=3600 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@ -453,7 +453,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: off (rndc) (stale-answer-ttl=4 max-stale-ttl=3600 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
grep '_default: stale cache enabled; stale answers disabled (stale-answer-ttl=4 max-stale-ttl=3600 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@ -481,7 +481,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: off (rndc) (stale-answer-ttl=3 max-stale-ttl=20 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
grep '_default: stale cache enabled; stale answers disabled (stale-answer-ttl=3 max-stale-ttl=20 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@ -500,7 +500,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: on (rndc) (stale-answer-ttl=3 max-stale-ttl=20 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
grep '_default: stale cache enabled; stale answers enabled (stale-answer-ttl=3 max-stale-ttl=20 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@ -733,7 +733,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: on (rndc) (stale-answer-ttl=3 max-stale-ttl=20 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
grep '_default: stale cache enabled; stale answers enabled (stale-answer-ttl=3 max-stale-ttl=20 stale-refresh-time=30)' rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@ -827,7 +827,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: on (rndc) (stale-answer-ttl=3 max-stale-ttl=20 stale-refresh-time=0)' rndc.out.test$n > /dev/null || ret=1
grep '_default: stale cache enabled; stale answers enabled (stale-answer-ttl=3 max-stale-ttl=20 stale-refresh-time=0)' rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@ -996,7 +996,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.3 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep "_default: off (stale-answer-ttl=$stale_answer_ttl max-stale-ttl=$max_stale_ttl stale-refresh-time=30)" rndc.out.test$n > /dev/null || ret=1
grep "_default: stale cache enabled; stale answers disabled (stale-answer-ttl=$stale_answer_ttl max-stale-ttl=$max_stale_ttl stale-refresh-time=30)" rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@ -1073,7 +1073,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.3 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep "_default: on (rndc) (stale-answer-ttl=$stale_answer_ttl max-stale-ttl=$max_stale_ttl stale-refresh-time=30)" rndc.out.test$n > /dev/null || ret=1
grep "_default: stale cache enabled; stale answers enabled (stale-answer-ttl=$stale_answer_ttl max-stale-ttl=$max_stale_ttl stale-refresh-time=30)" rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@ -1237,7 +1237,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.4 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep "_default: off (stale-answer-ttl=$stale_answer_ttl max-stale-ttl=$max_stale_ttl stale-refresh-time=30)" rndc.out.test$n > /dev/null || ret=1
grep "_default: stale cache enabled; stale answers disabled (stale-answer-ttl=$stale_answer_ttl max-stale-ttl=$max_stale_ttl stale-refresh-time=30)" rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@ -1443,7 +1443,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.5 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep "_default: off (not-cached)" rndc.out.test$n > /dev/null || ret=1
grep "_default: stale cache disabled; stale answers unavailable" rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@ -1604,7 +1604,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.3 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: on (stale-answer-ttl=3 max-stale-ttl=3600 stale-refresh-time=0)' rndc.out.test$n > /dev/null || ret=1
grep '_default: stale cache enabled; stale answers enabled (stale-answer-ttl=3 max-stale-ttl=3600 stale-refresh-time=0)' rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@ -2107,7 +2107,7 @@ n=$((n+1))
echo_i "check 'rndc serve-stale status' ($n)"
ret=0
$RNDCCMD 10.53.0.3 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: on (rndc) (stale-answer-ttl=3 max-stale-ttl=3600 stale-refresh-time=4)' rndc.out.test$n > /dev/null || ret=1
grep '_default: stale cache enabled; stale answers enabled (stale-answer-ttl=3 max-stale-ttl=3600 stale-refresh-time=4)' rndc.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))

View File

@ -418,17 +418,15 @@ option in \fBnamed.conf\fP\&.
See also \fBrndc managed\-keys\fP\&.
.TP
\fBserve\-stale\fP (\fBon\fP | \fBoff\fP | \fBreset\fP | \fBstatus\fP) [\fIclass\fP [\fIview\fP]]
This command enables, disables, resets, or reports the current status of the serving
of stale answers as configured in \fBnamed.conf\fP\&.
This command enables, disables, resets, or reports the current status of
the serving of stale answers as configured in \fBnamed.conf\fP\&.
.sp
If serving of stale answers is disabled by \fBrndc\-serve\-stale off\fP,
then it remains disabled even if \fBnamed\fP is reloaded or
reconfigured. \fBrndc serve\-stale reset\fP restores the setting as
configured in \fBnamed.conf\fP\&.
If serving of stale answers is disabled by \fBrndc\-serve\-stale off\fP, then it
remains disabled even if \fBnamed\fP is reloaded or reconfigured. \fBrndc
serve\-stale reset\fP restores the setting as configured in \fBnamed.conf\fP\&.
.sp
\fBrndc serve\-stale status\fP reports whether serving of stale
answers is currently enabled, disabled by the configuration, or
disabled by \fBrndc\fP\&. It also reports the values of
\fBrndc serve\-stale status\fP reports whether caching and serving of stale
answers is currently enabled or disabled. It also reports the values of
\fBstale\-answer\-ttl\fP and \fBmax\-stale\-ttl\fP\&.
.TP
.B \fBshowzone\fP \fIzone\fP [\fIclass\fP [\fIview\fP]]

View File

@ -96,6 +96,11 @@ Feature Changes
is set to ``no`` add to the DNS response payload without offering added value.
:gl:`#1316`
- The output of ``rndc serve-stale status`` has been clarified. It now
explicitly reports whether retention of stale data in the cache is enabled
(``stale-cache-enable``), and whether returning of such data in responses is
enabled (``stale-answer-enable``). :gl:`#2742`
Bug Fixes
~~~~~~~~~