[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#7829) MDB mdb_cursor_del causes records to be skipped



hyc@symas.com writes:
> Thanks for the report. Fixed now in mdb.master.

That fix breaks test052-memberof with pagesize 1024. Unrealistic, but
it's not a MAXKEYSIZE issue so it should not have made a difference.

Tested with RE24 9e22d8f2cd5ed10cd1dd22acbd729a49e5ecc1ab
+ mdb.master~ or mdb.master ac3acc121855e4297d597a4d71e9863e1e1e2450
+ this patch:

diff --git a/libraries/liblmdb/lmdb.h b/libraries/liblmdb/lmdb.h
index 2ebd43f..3f4a167 100644
--- a/libraries/liblmdb/lmdb.h
+++ b/libraries/liblmdb/lmdb.h
@@ -411,4 +411,4 @@ typedef enum MDB_cursor_op {
 	/** Too big key/data, key is empty, or wrong DUPFIXED size */
-#define MDB_BAD_VALSIZE		(-30781)
-#define MDB_LAST_ERRCODE	MDB_BAD_VALSIZE
+#define MDB_BAD_VALSIZE  (abort(),-30781) /* we don't hit MDB_MAXKEYSIZE */
+#define MDB_LAST_ERRCODE (-30781)
 /** @} */
diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c
index 7e29058..ad9bfc6 100644
--- a/libraries/liblmdb/mdb.c
+++ b/libraries/liblmdb/mdb.c
@@ -405,3 +405,3 @@ static txnid_t mdb_debug_start;
 #ifndef MDB_MAXKEYSIZE
-#define MDB_MAXKEYSIZE	 511
+#define MDB_MAXKEYSIZE 400 /* max-max is 446 for psize=1024 on 64-bit hosts */
 #endif
@@ -3536,3 +3536,3 @@ mdb_env_open2(MDB_env *env)
 		newenv = 1;
-		env->me_psize = env->me_os_psize;
+		env->me_psize = 1024;
 		if (env->me_psize > MAX_PAGESIZE)

-- 
Hallvard