2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Update Serving stale data

Diego dos Santos Fronza
2021-01-21 18:03:01 +00:00
parent bd440424fe
commit 3075c28070

@@ -114,12 +114,15 @@ If `stale-answer-client-timeout` is set to 0, we prioritize stale positive answe
Now what happens if both `stale-refresh-time` and `stale-answer-client-timeout` are used?
First let us look at the case where `stale-answer-client-timeout` is 0. A request comes in, BIND checks if there is a stale cache entry. If there is one that for which `stale-refresh-time` is active, the stale answer is used in the response to the client. No attempt to refresh the entry is made, because the time window explicitly tells us not to do so. If no useful stale data was found, this query will now result in a server failure response.
First let us look at the case where `stale-answer-client-timeout` is 0.
A request comes in, BIND checks if there is a stale cache entry and if one is found then:
If the `stale-refresh-time` window was inactive, the lookup will check if the stale entry in cache is a positive answer. If so, it can be used in the response to the client, and BIND starts an attempt to refresh the RRset. If the stale data is a negative cache entry, BIND will start resolving the query.
1. If `stale-refresh-time` is active for that RRset, then we have two situations:
- The stale cache entry is a positive answer: the stale answer is used in the response to the client, no attempt to refresh the entry is made, because the time window explicitly tells us not to do so.
- The stale cache entry is a negative answer: this query will now result in a server failure response.
What if the `stale-answer-client-timeout` is set to a positive value? Then if a stale cache entry exists, and if the `stale-refresh-time` window was active for this RRset, the entry is immediately returned, without an attempt to resolve the query.
If the `stale-refresh-time` window was inactive, a normal lookup follows. The stale cache entry is not immediately used. Either the query is resolved swiftly, and the answer from the authority is used in the response to the client, or resolving the query takes a long time and the `stale-answer-client-timeout` occurs.
2. If the `stale-refresh-time` window was inactive for that RRset, then again we have two situations:
- The stale cache entry is a positive answer: the stale answer is used in the response to the client but BIND starts an attempt to refresh the RRset.
- The stale cache entry is a negative answer: BIND will start resolving the query.
If the `stale-answer-client-timeout` occurs, a a database lookup for stale data is executed. BIND now acts the same as when `stale-refresh-time` is disabled: If that results in a stale positive answer, it is given to the client, while in the background BIND continues to resolve the query, with the goal of updating the cache entry (and if that resolver query times out, BIND falls back to stale data in cache, regardless whether it is a positive or negative entry). If no stale positive answer is available, the database lookup is dropped and BIND waits until the resolver is finished.