Remove the dead dns_expire_ttl code path and deletettl stats counter

Now that TTL-based cleaning has been removed, the dns_expire_ttl enum
value, its switch case in expireheader(), and the deletettl stats counter
(text, XML, JSON) are all dead code.  Remove them so the stats channel
no longer reports a permanently-zero counter.
This commit is contained in:
Ondřej Surý 2026-03-30 11:54:34 +02:00
parent 03ff80a1f7
commit 9e40f6508c
4 changed files with 3 additions and 18 deletions

View file

@ -562,9 +562,6 @@ dns_cache_dumpstats(dns_cache_t *cache, FILE *fp) {
fprintf(fp, "%20" PRIu64 " %s\n",
values[dns_cachestatscounter_deletelru],
"cache records deleted due to memory exhaustion");
fprintf(fp, "%20" PRIu64 " %s\n",
values[dns_cachestatscounter_deletettl],
"cache records deleted due to TTL expiration");
fprintf(fp, "%20" PRIu64 " %s\n",
values[dns_cachestatscounter_coveringnsec],
"covering nsec returned");
@ -617,8 +614,6 @@ dns_cache_renderxml(dns_cache_t *cache, void *writer0) {
values[dns_cachestatscounter_querymisses], writer));
TRY0(renderstat("DeleteLRU", values[dns_cachestatscounter_deletelru],
writer));
TRY0(renderstat("DeleteTTL", values[dns_cachestatscounter_deletettl],
writer));
TRY0(renderstat("CoveringNSEC",
values[dns_cachestatscounter_coveringnsec], writer));
@ -672,10 +667,6 @@ dns_cache_renderjson(dns_cache_t *cache, void *cstats0) {
CHECKMEM(obj);
json_object_object_add(cstats, "DeleteLRU", obj);
obj = json_object_new_int64(values[dns_cachestatscounter_deletettl]);
CHECKMEM(obj);
json_object_object_add(cstats, "DeleteTTL", obj);
obj = json_object_new_int64(values[dns_cachestatscounter_coveringnsec]);
CHECKMEM(obj);
json_object_object_add(cstats, "CoveringNSEC", obj);

View file

@ -120,10 +120,9 @@ enum {
dns_cachestatscounter_queryhits = 3,
dns_cachestatscounter_querymisses = 4,
dns_cachestatscounter_deletelru = 5,
dns_cachestatscounter_deletettl = 6,
dns_cachestatscounter_coveringnsec = 7,
dns_cachestatscounter_coveringnsec = 6,
dns_cachestatscounter_max = 8,
dns_cachestatscounter_max = 7,
/*%
* Query statistics counters (obsolete).

View file

@ -249,8 +249,7 @@ typedef enum {
typedef enum {
dns_expire_lru = 0,
dns_expire_ttl = 1,
dns_expire_flush = 2,
dns_expire_flush = 1,
} dns_expire_t;
/*

View file

@ -920,10 +920,6 @@ expireheader(dns_slabheader_t *header, isc_rwlocktype_t *nlocktypep,
}
switch (reason) {
case dns_expire_ttl:
isc_stats_increment(qpdb->cachestats,
dns_cachestatscounter_deletettl);
break;
case dns_expire_lru:
isc_stats_increment(qpdb->cachestats,
dns_cachestatscounter_deletelru);