]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #11815 from mind04/auth-notify
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Tue, 2 Aug 2022 13:33:10 +0000 (15:33 +0200)
committerGitHub <noreply@github.com>
Tue, 2 Aug 2022 13:33:10 +0000 (15:33 +0200)
auth: make sure a notified zone is in the zonecache

1  2 
pdns/mastercommunicator.cc

index 1da9f1f6c99137897b0d502650f6149310f13896,ce32897f4b3ba497d24116db2e31d65ed622d208..102a48475799741cc52f0c9c98d39fe96b846284
@@@ -191,20 -144,26 +192,21 @@@ void CommunicatorClass::masterUpdateChe
  
    UeberBackend *B=P->getBackend();
    vector<DomainInfo> cmdomains;
 -  B->getUpdatedMasters(&cmdomains);
 -  
 +  std::unordered_set<DNSName> catalogs;
 +  CatalogHashMap catalogHashes;
 +  B->getUpdatedMasters(cmdomains, catalogs, catalogHashes);
 +  getUpdatedProducers(B, cmdomains, catalogs, catalogHashes);
 +
    if(cmdomains.empty()) {
 -    if(d_masterschanged)
 -      g_log<<Logger::Info<<"No master domains need notifications"<<endl;
 -    d_masterschanged=false;
 +    g_log << Logger::Info << "no primary or producer domains need notifications" << endl;
    }
    else {
 -    d_masterschanged=true;
 -    g_log<<Logger::Notice<<cmdomains.size()<<" domain"<<(cmdomains.size()>1 ? "s" : "")<<" for which we are master need"<<
 -      (cmdomains.size()>1 ? "" : "s")<<
 -      " notifications"<<endl;
 +    g_log << Logger::Info << cmdomains.size() << " domain" << addS(cmdomains.size()) << " for which we are primary or consumer need" << addS(cmdomains.size()) << " notifications" << endl;
    }
  
 -  // figure out A records of everybody needing notification
 -  // do this via the FindNS class, d_fns
 -  
    for(auto& di : cmdomains) {
      purgeAuthCachesExact(di.zone);
+     g_zoneCache.add(di.zone, di.id);
      queueNotifyDomain(di, B);
      di.backend->setNotified(di.id, di.serial);
    }