mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 06:55:30 +00:00
new: usr: Print the expiration time of the stale records
Print the expiration time of the stale RRsets in the cache dump. Merge branch 'ondrej/print-expiration-time-of-stale-records' into 'main' See merge request isc-projects/bind9!10057
This commit is contained in:
@@ -115,8 +115,8 @@ sleep 2
|
|||||||
# stale for somewhere between 3500-3599 seconds.
|
# stale for somewhere between 3500-3599 seconds.
|
||||||
echo_i "check rndc dump stale data.example ($n)"
|
echo_i "check rndc dump stale data.example ($n)"
|
||||||
rndc_dumpdb ns1 || ret=1
|
rndc_dumpdb ns1 || ret=1
|
||||||
awk '/; stale/ { x=$0; getline; print x, $0}' ns1/named_dump.db.test$n \
|
awk '/; stale since [0-9]*/ { x=$0; getline; print x, $0}' ns1/named_dump.db.test$n \
|
||||||
| grep "; stale data\.example.*3[56]...*TXT.*A text record with a 2 second ttl" >/dev/null 2>&1 || ret=1
|
| grep "; stale since [0-9]* data\.example.*3[56]...*TXT.*A text record with a 2 second ttl" >/dev/null 2>&1 || ret=1
|
||||||
# Also make sure the not expired data does not have a stale comment.
|
# Also make sure the not expired data does not have a stale comment.
|
||||||
awk '/; authanswer/ { x=$0; getline; print x, $0}' ns1/named_dump.db.test$n \
|
awk '/; authanswer/ { x=$0; getline; print x, $0}' ns1/named_dump.db.test$n \
|
||||||
| grep "; authanswer longttl\.example.*[56]...*TXT.*A text record with a 600 second ttl" >/dev/null 2>&1 || ret=1
|
| grep "; authanswer longttl\.example.*[56]...*TXT.*A text record with a 600 second ttl" >/dev/null 2>&1 || ret=1
|
||||||
|
@@ -143,7 +143,10 @@ struct dns_rdataset {
|
|||||||
* This RRSIG RRset should be re-generated around this time.
|
* This RRSIG RRset should be re-generated around this time.
|
||||||
* Only valid if DNS_RDATASETATTR_RESIGN is set in attributes.
|
* Only valid if DNS_RDATASETATTR_RESIGN is set in attributes.
|
||||||
*/
|
*/
|
||||||
isc_stdtime_t resign;
|
union {
|
||||||
|
isc_stdtime_t resign;
|
||||||
|
isc_stdtime_t expire;
|
||||||
|
};
|
||||||
|
|
||||||
/*%
|
/*%
|
||||||
* Extra fields used by various rdataset implementations, that is, by
|
* Extra fields used by various rdataset implementations, that is, by
|
||||||
|
@@ -1160,7 +1160,12 @@ again:
|
|||||||
} else {
|
} else {
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
if (STALE(rds)) {
|
if (STALE(rds)) {
|
||||||
fprintf(f, "; stale\n");
|
isc_buffer_t b;
|
||||||
|
char buf[sizeof("YYYYMMDDHHMMSS")];
|
||||||
|
memset(buf, 0, sizeof(buf));
|
||||||
|
isc_buffer_init(&b, buf, sizeof(buf) - 1);
|
||||||
|
dns_time64_totext((uint64_t)rds->expire, &b);
|
||||||
|
fprintf(f, "; stale since %s\n", buf);
|
||||||
} else if (ANCIENT(rds)) {
|
} else if (ANCIENT(rds)) {
|
||||||
fprintf(f, "; expired (awaiting cleanup)\n");
|
fprintf(f, "; expired (awaiting cleanup)\n");
|
||||||
}
|
}
|
||||||
|
@@ -1105,6 +1105,7 @@ bindrdataset(qpcache_t *qpdb, qpcnode_t *node, dns_slabheader_t *header,
|
|||||||
rdataset->attributes |= DNS_RDATASETATTR_STALE_WINDOW;
|
rdataset->attributes |= DNS_RDATASETATTR_STALE_WINDOW;
|
||||||
}
|
}
|
||||||
rdataset->attributes |= DNS_RDATASETATTR_STALE;
|
rdataset->attributes |= DNS_RDATASETATTR_STALE;
|
||||||
|
rdataset->expire = header->expire;
|
||||||
} else if (!ACTIVE(header, now)) {
|
} else if (!ACTIVE(header, now)) {
|
||||||
rdataset->attributes |= DNS_RDATASETATTR_ANCIENT;
|
rdataset->attributes |= DNS_RDATASETATTR_ANCIENT;
|
||||||
rdataset->ttl = 0;
|
rdataset->ttl = 0;
|
||||||
|
Reference in New Issue
Block a user