]> 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:33:14 +0000 (16:33 +0100)
libraries/liblmdb/mdb.c

index 6fc72631dda6595b864b6843efa4d944edcdfa94..83bd131d1a90f18ea1e27368150ec10b73d01647 100644 (file)
@@ -2771,6 +2771,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