]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[v9_9] slaves notify before writing to disk
authorEvan Hunt <each@isc.org>
Fri, 22 Mar 2013 21:16:11 +0000 (14:16 -0700)
committerEvan Hunt <each@isc.org>
Fri, 22 Mar 2013 21:16:11 +0000 (14:16 -0700)
3537. [tuning] Slave zones, when updated, now send NOTIFY messages
to peers before being dumped to disk rather than
after. [RT #27242]
(cherry picked from commit e57a83b57659ae1d4f755a7841b519c047ec7f75)

CHANGES
lib/dns/zone.c

diff --git a/CHANGES b/CHANGES
index abde1dd07958556a7a835fa1d0e29ecec4391224..d8ef939e5da3baeae36cb716af380479349b44ce 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+3537.  [tuning]        Slave zones, when updated, now send NOTIFY messages
+                       to peers before being dumped to disk rather than
+                       after. [RT #27242]
+
 3535.  [bug]           Minor win32 cleanups. [RT #32962]
 
 3534.  [bug]           Extra text after an embedded NULL was ignored when
index 47a9df58d13a9ff6d24e75bf3d3073a99064f7dd..a4247ce4f203aaf65571094ab3f5304220edded3 100644 (file)
@@ -8645,6 +8645,14 @@ zone_maintenance(dns_zone_t *zone) {
                break;
        }
 
+       /*
+        * Slaves send notifies before backing up to disk, masters after.
+        */
+       if (zone->type == dns_zone_slave &&
+           DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDNOTIFY) &&
+           isc_time_compare(&now, &zone->notifytime) >= 0)
+               zone_notify(zone, &now);
+
        /*
         * Do we need to consolidate the backing store?
         */
@@ -8675,6 +8683,19 @@ zone_maintenance(dns_zone_t *zone) {
                break;
        }
 
+       /*
+        * Master/redirect zones send notifies now, if needed
+        */
+       switch (zone->type) {
+       case dns_zone_master:
+       case dns_zone_redirect:
+               if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDNOTIFY) &&
+                   isc_time_compare(&now, &zone->notifytime) >= 0)
+                       zone_notify(zone, &now);
+       default:
+               break;
+       }
+
        /*
         * Do we need to refresh keys?
         */
@@ -8699,12 +8720,6 @@ zone_maintenance(dns_zone_t *zone) {
        case dns_zone_master:
        case dns_zone_redirect:
        case dns_zone_slave:
-               /*
-                * Do we need to send out notify messages?
-                */
-               if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDNOTIFY) &&
-                   isc_time_compare(&now, &zone->notifytime) >= 0)
-                       zone_notify(zone, &now);
                /*
                 * Do we need to sign/resign some RRsets?
                 */
@@ -8718,7 +8733,7 @@ zone_maintenance(dns_zone_t *zone) {
                        isc_time_compare(&now, &zone->nsec3chaintime) >= 0)
                        zone_nsec3chain(zone);
                /*
-                * Do we need to issue a key expiry warning.
+                * Do we need to issue a key expiry warning?
                 */
                if (!isc_time_isepoch(&zone->keywarntime) &&
                    isc_time_compare(&now, &zone->keywarntime) >= 0)