]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10212 LMDB: init txnid for read-only DBs
authorHoward Chu <hyc@openldap.org>
Thu, 2 May 2024 15:29:03 +0000 (16:29 +0100)
committerHoward Chu <hyc@openldap.org>
Thu, 2 May 2024 15:29:03 +0000 (16:29 +0100)
libraries/liblmdb/mdb.c

index a8a8b90fbac0bc8d5896f0d8cad8e862b3a94d3d..bbc61c682aacf6a6adb87569c6f41a0e72eafb3a 100644 (file)
@@ -3088,6 +3088,10 @@ mdb_txn_renew0(MDB_txn *txn)
                                        UNLOCK_MUTEX(rmutex);
                                        return MDB_READERS_FULL;
                                }
+                               if ((env->me_flags & MDB_RDONLY) && !ti->mti_txnid)  {
+                                       meta = mdb_env_pick_meta(env);
+                                       ti->mti_txnid = meta->mm_txnid;
+                               }
                                r = &ti->mti_readers[i];
                                /* Claim the reader slot, carefully since other code
                                 * uses the reader table un-mutexed: First reset the