2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

Remove expired rdataset headers from the heap

It was discovered that an expired header could sit on top of the heap
a little longer than desireable.  Remove expired headers (headers with
rdh_ttl set to 0) from the heap completely, so they don't block the next
TTL-based cleaning.
This commit is contained in:
Ondřej Surý 2024-02-20 08:50:58 +01:00
parent 96171e9879
commit a9383e4b95
No known key found for this signature in database
GPG Key ID: 2820F37E873DEA41

View File

@ -337,6 +337,10 @@ dns__rbtdb_setttl(dns_slabheader_t *header, dns_ttl_t newttl) {
} else {
isc_heap_decreased(header->heap, header->heap_index);
}
if (newttl == 0) {
isc_heap_delete(header->heap, header->heap_index);
}
}
static bool
@ -4851,7 +4855,6 @@ dns__rbtdb_deletedata(dns_db_t *db ISC_ATTR_UNUSED,
if (header->heap != NULL && header->heap_index != 0) {
isc_heap_delete(header->heap, header->heap_index);
}
header->heap_index = 0;
if (IS_CACHE(rbtdb)) {
update_rrsetstats(rbtdb->rrsetstats, header->type,