]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
When lacking user-specified timer values from the SOA,
authorAndreas Gustafsson <source@isc.org>
Tue, 26 Sep 2000 18:17:10 +0000 (18:17 +0000)
committerAndreas Gustafsson <source@isc.org>
Tue, 26 Sep 2000 18:17:10 +0000 (18:17 +0000)
use a retry time that backs off exponentially from one minute up to
six hours.  This should allow the xferquota test to succeed [RT #337]
by allowing for one or more retries during the test, while keeping the
amount of SOA query traffic to dead masters reasonable for GNS.

CHANGES
lib/dns/include/dns/zone.h
lib/dns/zone.c

diff --git a/CHANGES b/CHANGES
index 156c63ee30e65d03031c7c19fe600deb113294d9..7b824bed6c61a2460328f25b21940f539b6d66b4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+
+ 490.  [func]          When a slave/stub zone has not yet successfully
+                       obtained an SOA containing the zone's configured
+                       retry time, perform the SOA query retries using
+                       exponential backoff. [RT #337]
+
  489.  [func]          The zone manager now has a "i/o" queue.
 
  488.  [bug]           Locks weren't properly destroyed in some cases.
index a3a34a1ba7842fadb5aa9248d0f99f0d4fa1b0ba..72f4df927901161f24b62f1330b8c28431c6bfb5 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: zone.h,v 1.76 2000/09/26 17:24:00 gson Exp $ */
+/* $Id: zone.h,v 1.77 2000/09/26 18:17:10 gson Exp $ */
 
 #ifndef DNS_ZONE_H
 #define DNS_ZONE_H 1
@@ -66,7 +66,8 @@ typedef enum {
 #define DNS_ZONE_MAXRETRY              1209600 /* 2 weeks */
 #endif
 #ifndef DNS_ZONE_DEFAULTRETRY
-#define DNS_ZONE_DEFAULTRETRY             1800 /* 30 minutes */
+#define DNS_ZONE_DEFAULTRETRY               60 /* 1 minute, subject to
+                                                  exponential backoff */
 #endif
 
 ISC_LANG_BEGINDECLS
index 6bd999a8bbee577944a5a54bcc4b87c822cf98b7..8ac354075b4490fdafad66264f665d85d143ba2b 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: zone.c,v 1.221 2000/09/26 17:28:13 gson Exp $ */
+/* $Id: zone.c,v 1.222 2000/09/26 18:17:09 gson Exp $ */
 
 #include <config.h>
 
@@ -205,6 +205,9 @@ struct dns_zone {
                                                 * zone with no masters
                                                 * occured */
 #define DNS_ZONEFLG_LOADING    0x00002000U     /* load from disk in progress */
+#define DNS_ZONEFLG_HAVETIMERS 0x00004000U     /* timer values have been set from
+                                                  SOA (if not set, we are still using
+                                                  default timer values) */
 
 #define DNS_ZONE_OPTION(z,o) (((z)->options & (o)) != 0)
 
@@ -1056,8 +1059,9 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime,
                                    zone->minretry, zone->maxretry);
                zone->expire = RANGE(expire, zone->refresh + zone->retry,
                                     DNS_MAX_EXPIRE);
-
                zone->minimum = minimum;
+               zone->flags |= DNS_ZONEFLG_HAVETIMERS;
+
                if (zone->type == dns_zone_slave ||
                    zone->type == dns_zone_stub) {
                        isc_time_t t;
@@ -1741,6 +1745,7 @@ zone_expire(dns_zone_t *zone) {
        zone->flags |= DNS_ZONEFLG_EXPIRED;
        zone->refresh = DNS_ZONE_DEFAULTREFRESH;
        zone->retry = DNS_ZONE_DEFAULTRETRY;
+       zone->flags &= ~DNS_ZONEFLG_HAVETIMERS;
        zone_unload(zone);
 }
 
@@ -1787,6 +1792,14 @@ dns_zone_refresh(dns_zone_t *zone) {
                 "refresh time (%u/%u), now %u",
                 zone->refreshtime, zone->refresh, now);
 
+       /*
+        * When lacking user-specified timer values from the SOA,
+        * do exponential backoff of the retry time up to a 
+        * maximum of six hours.
+        */
+       if (! DNS_ZONE_FLAG(zone, DNS_ZONEFLG_HAVETIMERS))
+               zone->retry = ISC_MIN(zone->retry * 2, 6 * 3600);
+
        zone->curmaster = 0;
        /* initiate soa query */
        queue_soa_query(zone);
@@ -2716,6 +2729,9 @@ stub_callback(isc_task_t *task, isc_event_t *event) {
        return;
 }
 
+/*
+ * An SOA query has finished (successfully or not).
+ */
 static void
 refresh_callback(isc_task_t *task, isc_event_t *event) {
        const char me[] = "refresh_callback";
@@ -4247,6 +4263,7 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) {
                                             zone->refresh + zone->retry,
                                             DNS_MAX_EXPIRE);
                        zone->minimum = minimum;
+                       zone->flags |= DNS_ZONEFLG_HAVETIMERS;
                }
 
                /*