[Pdns-users] [PATCH] Can't determine backend for domain / Slave

Oliver Peter lists at peter.de.com
Tue Oct 9 09:31:09 UTC 2012


Hi there,

We have an issue with a PowerDNS 2.9.22 acting as a slave:

Before 4th of October our customer had configured 'foo.bar' as slave of    
his master 1.2.3.4.  The slave temporarily served an out of sync 
zonefile, but I think this is unrelated.

Our customer then reconfigured the zone to other nameservers and also  
deleted the entry from our ns1.  Since then we see a lot of messages 
stating "Can't determine backend for domain 'foo.bar'" - even that the 
domain can't be found in the database anymore (neither domains nor
records):
        
/var/log/messages.1:Oct  3 15:40:30 ns1 pdns[5740]: Domain foo.bar is stale, master serial 2012100121, our serial 2011051901
/var/log/messages.1:Oct  3 15:46:29 ns1 pdns[5740]: Initiating transfer of 'foo.bar' from remote '1.2.3.4'
/var/log/messages.1:Oct  3 15:46:29 ns1 pdns[5740]: AXFR started for 'foo.bar', transaction started
[...]
/var/log/messages.1:Oct  4 12:49:51 ns1 pdns[5740]: Initiating transfer of 'foo.bar' from remote '1.2.3.4'
/var/log/messages.1:Oct  4 12:49:51 ns1 pdns[5740]: AXFR started for 'foo.bar', transaction started
/var/log/messages.1:Oct  4 12:49:51 ns1 pdns[5740]: AXFR done for 'foo.bar', zone committed
/var/log/messages.1:Oct  4 15:32:37 ns1 pdns[5740]: Initiating transfer of 'foo.bar' from remote '1.2.3.4'
[...]
/var/log/messages:Oct  8 11:05:27 ns1 pdns[5740]: Initiating transfer of 'foo.bar' from remote '1.2.3.4'
/var/log/messages:Oct  8 11:05:27 ns1 pdns[5740]: Can't determinebackend for domain 'foo.bar'

We suspect a race condition where CommunicatorClass::slaveRefresh
does not check if the (database)backend if the domain is still there or
has already been deleted.
The return value of B->getDomainInfo(di.zone, di); has to be verified:
                                                               
Index: pdns/slavecommunicator.cc
===================================================================
--- pdns/slavecommunicator.cc   (revision 2759)
+++ pdns/slavecommunicator.cc   (working copy)
@@ -577,8 +577,12 @@
   typedef DomainNotificationInfo val_t;
   BOOST_FOREACH(val_t& val, sdomains) {
     DomainInfo& di(val.di);
-    if(!di.backend) // might've come from the packethandler
-      B->getDomainInfo(di.zone, di);
+    // might've come from the packethandler
+    if(!di.backend && !B->getDomainInfo(di.zone, di)) {
+       L<<Logger::Warning<<"Ignore domain "<< di.zone<<" since it has been removed from our backend"<<endl;
+       continue;
+    }
+
     if(!ssr.d_freshness.count(di.id))
       continue;
     uint32_t theirserial = ssr.d_freshness[di.id].theirSerial, ourserial = di.serial;

Cheers
Oliver

--
Oliver PETER       oliver at opdns.de       0x456D688F
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20121009/2c42268b/attachment.sig>


More information about the Pdns-users mailing list