]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: catalog zones, avoid bulk zone reset while migrating to a catalog
authorKees Monshouwer <mind04@monshouwer.org>
Mon, 24 Oct 2022 08:24:06 +0000 (10:24 +0200)
committermind04 <mind04@monshouwer.org>
Mon, 24 Oct 2022 11:47:46 +0000 (13:47 +0200)
pdns/slavecommunicator.cc

index fe5c40a5aaa151522090d7cf893f051707121fb5..5cec49137fd7bd6e4f39adba0473b94a9ecfc277 100644 (file)
@@ -121,7 +121,13 @@ static bool catalogDiff(const DomainInfo& di, vector<CatalogInfo>& fromXFR, vect
       else {
         CatalogInfo ciXFR = *xfr;
         CatalogInfo ciDB = *db;
-        if (ciXFR.d_unique == ciDB.d_unique) { // update
+        if (ciDB.d_unique.empty() || ciXFR.d_unique == ciDB.d_unique) { // update
+
+          if (ciDB.d_unique.empty()) { // set unique
+            g_log << Logger::Warning << logPrefix << "set unique, zone '" << ciXFR.d_zone << "' is now a member" << endl;
+            ciDB.d_unique = ciXFR.d_unique;
+            doOptions = true;
+          }
 
           if (ciXFR.d_coo != ciDB.d_coo) { // update coo
             g_log << Logger::Warning << logPrefix << "update coo for zone '" << ciXFR.d_zone << "' to '" << ciXFR.d_coo << "'" << endl;