Only cleanup headers that are less than equal to the rbt's last_used time. Adjust the rbt's last_used time when the target cleaning was not achieved to the oldest value of the remaining set of headers. When updating delegating NS and glue records last_used was not being updated when it should have been. When adding zero TTL records to the tail of the LRU lists set last_used to rbtdb->last_used + 1 rather than now. This appoximately preserves the lists LRU order.
129 KiB
129 KiB