]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Revert "ITS#8250 LMDB: add option MDB_ROTXN_RESET flag for txn_begin"
authorHoward Chu <hyc@openldap.org>
Sun, 26 Apr 2026 14:07:40 +0000 (15:07 +0100)
committerHoward Chu <hyc@openldap.org>
Sun, 26 Apr 2026 14:07:40 +0000 (15:07 +0100)
This reverts commit 4cd8e451679511c8fbeff68f8a97cbe7b1268b48.
Cost/benefit makes no sense.

libraries/liblmdb/lmdb.h
libraries/liblmdb/mdb.c

index 3969ee81f7bfdebca7502842a3e36b94184799b4..da7b3c94a602248efca0c6a11c714decc212f9d6 100644 (file)
@@ -372,13 +372,6 @@ typedef void (MDB_sum_func)(const MDB_val *src, MDB_val *dst, const MDB_val *key
 #define MDB_REMAP_CHUNKS       0x4000000
 /** @} */
 
-/** @defgroup  mdb_txn_begin   Transaction Flags
- *     @{
- */
-       /** don't initialize read-only txn; #mdb_txn_renew() must be called before first use */
-#define MDB_ROTXN_RESET        0x8000000
-/** @} */
-
 /**    @defgroup       mdb_dbi_open    Database Flags
  *     @{
  */
@@ -1150,8 +1143,6 @@ int mdb_env_set_checksum(MDB_env *env, MDB_sum_func *func, unsigned int size);
         *              Don't flush system buffers to disk when committing this transaction.
         *      <li>#MDB_NOMETASYNC
         *              Flush system buffers but omit metadata flush when committing this transaction.
-        *      <li>#MDB_ROTXN_RESET
-        *              Must call #mdb_txn_renew() before using this readonly transaction.
         * </ul>
         * @param[out] txn Address where the new #MDB_txn handle will be stored
         * @return A non-zero error value on failure and 0 on success. Some possible
index 45d29f1f148631fe32ca34415ccb703dac691654..03f0a19ea1a561b7c4f25d9d2547f6864f48e1d5 100644 (file)
@@ -1512,7 +1512,7 @@ struct MDB_txn {
  *     @{
  */
        /** #mdb_txn_begin() flags */
-#define MDB_TXN_BEGIN_FLAGS    (MDB_NOMETASYNC|MDB_NOSYNC|MDB_RDONLY|MDB_ROTXN_RESET)
+#define MDB_TXN_BEGIN_FLAGS    (MDB_NOMETASYNC|MDB_NOSYNC|MDB_RDONLY)
 #define MDB_TXN_NOMETASYNC     MDB_NOMETASYNC  /**< don't sync meta for this txn on commit */
 #define MDB_TXN_NOSYNC         MDB_NOSYNC      /**< don't sync this txn on commit */
 #define MDB_TXN_RDONLY         MDB_RDONLY      /**< read-only transaction */
@@ -3487,9 +3487,6 @@ mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **ret)
        if (env->me_flags & MDB_RDONLY & ~flags) /* write txn in RDONLY env */
                return MDB_IS_READONLY;
 
-       if ((flags & MDB_ROTXN_RESET) && !(flags & MDB_RDONLY)) /* MDB_ROTXN_RESET requires MDB_RDONLY */
-               return EINVAL;
-
        if (parent) {
                /* Nested transactions:
                 * Only write txns may have nested txns;
@@ -3609,12 +3606,7 @@ mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **ret)
        } else { /* MDB_RDONLY */
                txn->mt_dbiseqs = env->me_dbiseqs;
 renew:
-               if (F_ISSET(flags, MDB_ROTXN_RESET)) {
-                       rc = MDB_SUCCESS;
-                       flags ^= (MDB_ROTXN_RESET|MDB_TXN_FINISHED);
-               } else {
-                       rc = mdb_txn_renew0(txn);
-               }
+               rc = mdb_txn_renew0(txn);
        }
        if (rc) {
                if (txn != env->me_txn0) {