Revert "ITS#8250 LMDB: add option MDB_ROTXN_RESET flag for txn_begin"

This reverts commit 4cd8e45167.
Cost/benefit makes no sense.
This commit is contained in:
Howard Chu 2026-04-26 15:07:40 +01:00
parent 7a1f36d51a
commit ed917c6c02
2 changed files with 2 additions and 19 deletions

View 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

View 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) {