]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth lmdb: when broadcasting indexes, -do- rewrite them even if they are unchanged 13099/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Wed, 2 Aug 2023 12:35:32 +0000 (14:35 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 3 Aug 2023 09:43:12 +0000 (11:43 +0200)
(cherry picked from commit e0e59b3868b4caf7a2e4f93e6d8a802b8d83eccd)

ext/lmdb-safe/lmdb-typed.hh

index ad5bb07c8a788c778535d8a6558ec1c3c1fc2429..2a45e0684fe291863efc0aa439082bf14735713b 100644 (file)
@@ -164,10 +164,8 @@ struct LMDBIndexOps
 
     MDBOutVal currentvalue;
 
-    // check if the entry already exists, so we don't uselessly bump the timestamp
-    if (txn->get(d_idx, combined, currentvalue) == MDB_NOTFOUND) {
-      txn->put(d_idx, combined, empty, flags);
-    }
+    // if the entry existed already, this will just update the timestamp/txid in the LS header. This is intentional, so objects and their indexes always get synced together.
+    txn->put(d_idx, combined, empty, flags);
   }
 
   void del(MDBRWTransaction& txn, const Class& t, uint32_t id)