Should have enclosed a test program. Here: http://folk.uio.no/hbf/testsize.c Output: process #0: open env process #1: open env process #0: write txn, mapsize 204800 process #1: write txn, mapsize 40960 process #2: open env, write txn, mapsize 40960 process #3: open env, write txn, mapsize 204800
Summarizing a reply which got sent privately instead of to ITS: On 2014-01-24 00:07, Howard Chu wrote: > The doc says the caller of set_mapsize is required to make sure there > are no active transactions when it is called. As such, X failed this > requirement, and this sequence of events is explicitly unsupported. No, I'm talking about X changing the mapsize when there is no txn, then afterwards doing a write txn so the mapsize gets written. > If Y doesn't start its write txn until after X finishes, then Y will > see the new size. It doesn't, that's the point. Only txn_commit pays attention, and it checks the size which existed in the wrong metapage. Come to think of it, set_mapsize(); env_open(); txn begin/end should do the same. Y will either way not pay attention to the new mapsize. -- Hallvard
