]> granicus.if.org Git - pdns/commitdiff
requeue serial check if NOTIFY comes in while incoming AXFR is ongoing
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 12 Apr 2018 18:33:41 +0000 (20:33 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 12 Apr 2018 18:33:41 +0000 (20:33 +0200)
pdns/communicator.cc
pdns/slavecommunicator.cc

index 27d6f3507e40634c6b533fa1a5adaeea082e6008..e521b5d6e2d138706651ec9af02dfabaf5bd50fa 100644 (file)
@@ -125,8 +125,17 @@ void CommunicatorClass::mainloop(void)
       while(time(0) < next) {
         rc=d_any_sem.tryWait();
 
-        if(rc)
+        if(rc) {
+          bool extraSlaveRefresh = false;
           Utility::sleep(1);
+          {
+            Lock l(&d_lock);
+            if (d_tocheck.size())
+              extraSlaveRefresh = true;
+          }
+          if (extraSlaveRefresh)
+            slaveRefresh(&P);
+        }
         else { 
           break; // something happened
         }
index 37b42de0e2e3de99b24632df391b049608001642..9dd57548b8b4494cd602226068699cb9c7c18255 100644 (file)
@@ -736,8 +736,18 @@ void CommunicatorClass::slaveRefresh(PacketHandler *P)
   set<DNSPacket, cmp> trysuperdomains;
   {
     Lock l(&d_lock);
-    rdomains.insert(rdomains.end(), d_tocheck.begin(), d_tocheck.end());
-    d_tocheck.clear();
+    set<DomainInfo> requeue;
+    for(const auto& di: d_tocheck) {
+      if(d_inprogress.count(di.zone)) {
+        g_log<<Logger::Debug<<"Got NOTIFY for "<<di.zone<<" while AXFR in progress, requeueing SOA check"<<endl;
+        requeue.insert(di);
+      }
+      else {
+        g_log<<Logger::Debug<<"Got NOTIFY for "<<di.zone<<", going to check SOA serial"<<endl;
+        rdomains.push_back(di);
+      }
+    }
+    d_tocheck.swap(requeue);
 
     trysuperdomains = d_potentialsupermasters;
     d_potentialsupermasters.clear();