aboutsummaryrefslogtreecommitdiff
path: root/external/db_drivers/liblmdb/lmdb.h
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2017-08-12 12:21:25 +0100
committerHoward Chu <hyc@symas.com>2017-08-12 12:21:25 +0100
commit9c6eb75c656363176a55c63c81803feb3cfa614d (patch)
treeb46956d659a9047b4d0730081fff4ca3cd6c3ca8 /external/db_drivers/liblmdb/lmdb.h
parentMerge pull request #2263 (diff)
downloadmonero-9c6eb75c656363176a55c63c81803feb3cfa614d.tar.xz
ITS#8704 add MDB_PREVSNAPSHOT flag to mdb_env_open
used to open the previous snapshot, in case the latest one is corrupted
Diffstat (limited to 'external/db_drivers/liblmdb/lmdb.h')
-rw-r--r--external/db_drivers/liblmdb/lmdb.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/external/db_drivers/liblmdb/lmdb.h b/external/db_drivers/liblmdb/lmdb.h
index a794c9f7d..0bca3eb74 100644
--- a/external/db_drivers/liblmdb/lmdb.h
+++ b/external/db_drivers/liblmdb/lmdb.h
@@ -311,6 +311,8 @@ typedef void (MDB_rel_func)(MDB_val *item, void *oldptr, void *newptr, void *rel
#define MDB_NORDAHEAD 0x800000
/** don't initialize malloc'd memory before writing to datafile */
#define MDB_NOMEMINIT 0x1000000
+ /** use the previous snapshot rather than the latest one */
+#define MDB_PREVSNAPSHOT 0x2000000
/** @} */
/** @defgroup mdb_dbi_open Database Flags
@@ -622,6 +624,12 @@ int mdb_env_create(MDB_env **env);
* caller is expected to overwrite all of the memory that was
* reserved in that case.
* This flag may be changed at any time using #mdb_env_set_flags().
+ * <li>#MDB_PREVSNAPSHOT
+ * Open the environment with the previous snapshot rather than the latest
+ * one. This loses the latest transaction, but may help work around some
+ * types of corruption. If opened with write access, this must be the
+ * only process using the environment. This flag is automatically reset
+ * after a write transaction is successfully committed.
* </ul>
* @param[in] mode The UNIX permissions to set on created files and semaphores.
* This parameter is ignored on Windows.