]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
reinstate lmdb-schema-version setting
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 17 Mar 2023 09:12:47 +0000 (10:12 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 17 Mar 2023 09:12:47 +0000 (10:12 +0100)
modules/lmdbbackend/lmdbbackend.cc

index 9e51159cb4a5d7f0064fdac2a6e1d6094a86b9a5..f8d566ccc5b79448d152fb47c6160c4893517060 100644 (file)
@@ -668,7 +668,9 @@ LMDBBackend::LMDBBackend(const std::string& suffix)
       uint32_t currentSchemaVersion = currentSchemaVersionAndShards.first;
       // std::cerr<<"current schema version: "<<currentSchemaVersion<<", shards="<<currentSchemaVersionAndShards.second<<std::endl;
 
-      // FIXME: I accidentally took out the code that checks pdns.conf lmdb-schema-version
+      if (getArgAsNum("schema-version") != SCHEMAVERSION) {
+        throw std::runtime_error("This version of the lmdbbackend only supports schema version 5. Configuration demands a lower version. Not starting up.");
+      }
 
       if (currentSchemaVersion > 0 && currentSchemaVersion < 3) {
         throw std::runtime_error("this version of the lmdbbackend can only upgrade from schema v3/v4 to v5. Upgrading from older schemas is not yet supported.");