dns_zone_t->loadtime is zero after initial AXFR of a secondary zone
Summary
When a server is configured as a secondary for a zone and no backing zone file exists yet, the initial AXFR of the zone from the primary doesn't set the loadtime
for the zone on the secondary. Once the secondary is restarted, and the zone can be loaded from the backing file, loadtime
is set correctly.
Steps to reproduce
The statschannel
test already has a check for this behavior, but it was disabled to avoid a persistent failure. Uncomment the assert
statements in check_loadtime()
and run pytest -k test_zone_timers_secondary_json
.
What is the current bug behavior?
If secondary is queried for the zones through the stats channel, loadtime
is set to 1970-01-01T00:00:00Z
:
...
"zones":[
{
"name":"example",
"class":"IN",
"serial":1,
"type":"secondary",
"loaded":"1970-01-01T00:00:00Z",
"expires":"2023-04-21T12:24:32Z",
"refresh":"2023-03-31T12:29:25Z"
}
]
...
What is the expected correct behavior?
loaded
should be the time when the initial AXFR completes.
Relevant configuration files
Edited by Nicki Křížek