Howard Chu
81984ab228
Fix 418ea8b94e SEGV on spilled ovpg
...
Don't spill an ovpg that is referenced in a cursor
4 years ago
Hallvard Furuseth
adfa8f758a
Drop P_DIRTY, and MDB_WRITEMAP dirty/spill lists
...
mt_workid = mt_txnid when WRITEMAP, so dirty pages == "spilled"
pages and mdb_page_flush() does nothing.
4 years ago
Hallvard Furuseth
f1db84d332
mp_txnid = page state, avoids searching dirty_list
...
In nested txns, check mp_txnid to see which txn dirtied the page.
This change will also let us remove the P_DIRTY flag, and keep
some flags in (dirty page).mp_txnid if we should need it.
4 years ago
Hallvard Furuseth
c83434e178
Demo - move P_DIRTY to P_ADM_FLAGS, page_dirty()
...
...to have something substantial to test P_ADM_FLAGS with,
at least until we drop the P_DIRTY flag.
4 years ago
Hallvard Furuseth
0a99df54af
Divide page flags in P_ADM_FLAGS and the rest
...
P_ADM_FLAGS flags are tied to the page, even through page_loose-alloc.
OTOH mdb_page_split() should only duplicate the relevant flags.
This is just the code for the feature, P_ADM_FLAGS is 0 for now.
We'll need it for P_HIDESPILL later.
4 years ago
Hallvard Furuseth
3b55853fe0
Drop unnecessary searches in the spill lists
...
Check with IS_MUTABLE() if an MDB_page is spilled, instead of
searching spill lists. When unspilling, skip parent spill lists.
4 years ago
Hallvard Furuseth
34461da97b
Skip unnecessary mdb_page_get()s when spilling
...
Do not bring in pages merely to see if they should be skipped.
4 years ago
Hallvard Furuseth
6dd5a4d7f6
Protect freelist at end of mdb_freelist_save()
4 years ago
Hallvard Furuseth
12ee1a2d71
Use mdb_page_loose() more
4 years ago
Hallvard Furuseth
0e17ba43a8
Verify final loose_count in mdb_txn_commit()
...
Mismatch may indicate that pages leaked or got used twice
in the same snapshot.
4 years ago
Hallvard Furuseth
4b7e430303
mdb_page_touch: Always set MDB_TXN_ERROR on error
4 years ago
Hallvard Furuseth
9e3603eb9d
Fix mdb_enctest()
...
Accept a partial ovpage. I.e. decryption of the beginning
should not depend on the data at the end.
Make the key and IV less regular. (Divisor 67 has period>64.)
4 years ago
Hallvard Furuseth
214aff2359
Move misplaced OVERFLOW_NOTYET code
...
...so it would set pgno,txnid in the MDB_dovpage, not the actual ovpage
4 years ago
Hallvard Furuseth
74928f6a3b
Fix broken mdb_page_get(ovpage) optimization
4 years ago
Hallvard Furuseth
ca8e48d994
Fix last commit - sizeof(pgno_t) and C90 compat
4 years ago
Howard Chu
757378fc1d
Scaled back on overflow page work
...
Still keeping page header at top of overflow page for now
4 years ago
Howard Chu
f0f985fa93
checkpoint - moving overflow page headers
...
Moving headers outside of overflow page.
4 years ago
Howard Chu
c7ef535aa9
Data format change: add txnid to page header
4 years ago
Hallvard Furuseth
f16ce88dc8
Trivial encryption when $LMDB_FLAGS = "e"
4 years ago
Hallvard Furuseth
de161fe9d9
Get flags from $LMDB_FLAGS when MDB_TEST
...
Now we don't need to tweak the code of callers to test encryption.
4 years ago
Howard Chu
fafbd42cd2
Save/restore enc IV in page 0
4 years ago
Howard Chu
34c3cfe853
Plug some information leaks
...
Zero out decrypted pages before freeing them.
Do proper init on reused loose pages.
4 years ago
Howard Chu
525a2cce91
Add test code for remap / encryption
4 years ago
Howard Chu
b89f8fc9bc
Page-level encryption support
...
Currently encrypts all but the meta pages
Still needs to store/retrieve the initialization vector
4 years ago
Hallvard Furuseth
fbf35a163f
Rename mdb_env_close0() -> mdb_env_close_active()
...
Hopefully we'll remember now what goes in which function.
4 years ago
Howard Chu
ad7933ba0c
Optimization for mdb_rpage_get()
...
The caller already knows if it's using an overflow page, so
pass the number of expected pages in instead of having to
map the page first and check the count there.
4 years ago
Howard Chu
53799e51da
RPAGE_CACHE is now dynamically selectable
...
Behavior is controlled by MDB_REMAP_CHUNKS envflag
Remapping is always enabled in MDB_VL32
4 years ago
Howard Chu
ac047d1eff
Add new MDB_RPAGE_CACHE def
...
Separate 32/64 dependency from rpage buffer mechanism
4 years ago
Howard Chu
775be5e50f
Fix Android recognition
...
The official macro is __ANDROID__; ANDROID may or may not be defined.
8 years ago
Howard Chu
348885413e
MDB_VL32
...
Use the same size dirty list for both 64 and 32 bit.
8 years ago
Howard Chu
4d2154397a
ITS#8622 fix xcursor after cursor_del
...
Re-fix 6b1df0e4c7
from ITS#8406
8 years ago
Hallvard Furuseth
b5e5fcc31d
ITS#8582 Fill in MDB_LOCK_FORMAT
...
Attempt to stop liblmdb variants compiled with conflicting options
from using the lockfile at the same time and thus breaking it.
8 years ago
Hallvard Furuseth
52c0df1d50
Clear any struct padding in idbuf
8 years ago
Hallvard Furuseth
172d825155
Simplify mdb_hash_val() -> mdb_hash()
...
Simpler usage since it's only called once, rename to match new usage,
and drop 3 loop pessimizations which were optimizations 20 years ago.
8 years ago
Hallvard Furuseth
68eda68f0b
Store lock ID instead of pathname in lockfile
...
This limits the namespace which the user can meddle with for
POSIX semaphores and Windows mutexes. Their names change a
bit, they no longer have fixed lengths.
8 years ago
Hallvard Furuseth
58ba039b8f
ITS#8582 MDB_LOCK_VERSION = 2 due to format change
8 years ago
Howard Chu
e36517dbbe
ITS#8582 keep mutex at end of struct
...
since it's variable size on Linux/glibc
8 years ago
Howard Chu
1db9f32ae2
Workaround VL32 cursor refcounting miscount
...
Don't try to deref cursor page if txn's pagelist is empty
8 years ago
Howard Chu
882e27c1b4
Further fix f8ce8a8271
...
Fully revert the change to GET_MULTIPLE
8 years ago
Howard Chu
5eae7aad7e
Fix f8ce8a8271
...
GET_MULTIPLE was broken
8 years ago
Howard Chu
6ac9aa666e
Happy New Year
8 years ago
Howard Chu
f8ce8a8271
More C_EOF tweaks
8 years ago
Howard Chu
c44b29eaa8
ITS#8557 fix prev commit
8 years ago
Howard Chu
511f5880e2
Tweak cursor_next C_EOF check
...
Allow C_EOF flag to be stale
8 years ago
Howard Chu
d84dee516f
ITS#8557 fix mdb_cursor_last
...
Optimize mdb_page_search_root(PS_LAST) when cursor is already near
last position, ignoring C_EOF flag for now.
8 years ago
Howard Chu
59ac317d2a
ITS#8558 fix mdb_load with escaped plaintext
8 years ago
Howard Chu
2e3eaf2ce2
ITS#8554 kFreeBSD is like BSD
...
Doesn't have POSIX robust mutexes - GNU userland on BSD kernel
8 years ago
Hallvard Furuseth
4bc270a2cb
More MDB_node doc
8 years ago
Hallvard Furuseth
be94a7565b
Doxygen fixes. Use DISTRIBUTE_GROUP_DOC.
...
- DISTRIBUTE_GROUP_DOC makes doxygen give several fields the
same doc: mn_hi + mn_lo in MDB_node.
- With mdb_mutex_t + mdb_mutexref_t, instead split them up.
- Don't hide a doxygen #name inside double quotes.
8 years ago
Hallvard Furuseth
72c893fc82
Mention MDB_PREV_MULTIPLE along with MDB_NEXT_MULTIPLE
8 years ago