It is more intuitive to have the countdown 'max-stale-ttl' as the
RRset TTL, instead of 0 TTL. This information was already available
in a comment "; stale (will be retained for x more seconds", but
Support suggested to put it in the TTL field instead.
(cherry picked from commit
a83c8cb0afd88d54b9cf67239f2495c9b0391e97)
echo_i "check rndc dump stale data.example ($n)"
rndc_dumpdb ns1 || ret=1
awk '/; stale/ { x=$0; getline; print x, $0}' ns1/named_dump.db.test$n |
- grep "; stale (will be retained for 3[56].. more seconds) data\.example.*A text record with a 2 second ttl" > /dev/null 2>&1 || ret=1
+ grep "; stale 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.
awk '/; answer/ { x=$0; getline; print x, $0}' ns1/named_dump.db.test$n |
- grep "; answer longttl\.example.*A text record with a 600 second ttl" > /dev/null 2>&1 || ret=1
+ grep "; answer longttl\.example.*[56]...*TXT.*A text record with a 600 second ttl" > /dev/null 2>&1 || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
} else {
isc_result_t result;
if (STALE(rds)) {
- fprintf(f,
- "; stale (will be retained for %u more "
- "seconds)\n",
- rds->stale_ttl);
+ fprintf(f, "; stale\n");
} else if (ANCIENT(rds)) {
isc_buffer_t b;
char buf[sizeof("YYYYMMDDHHMMSS")];
}
rdataset->attributes |= DNS_RDATASETATTR_STALE;
rdataset->stale_ttl = stale_ttl;
- rdataset->ttl = 0;
+ rdataset->ttl = stale_ttl;
} else if (IS_CACHE(rbtdb) && !ACTIVE(header, now)) {
rdataset->attributes |= DNS_RDATASETATTR_ANCIENT;
rdataset->stale_ttl = header->rdh_ttl;
count++;
assert_in_range(count, 0, 49); /* loop sanity */
assert_int_equal(result, ISC_R_SUCCESS);
- assert_int_equal(rdataset.ttl, 0);
assert_int_equal(rdataset.attributes &
DNS_RDATASETATTR_STALE,
DNS_RDATASETATTR_STALE);