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

Re: (ITS#7789) Unreliable mdb_env_set_mapsize()



Another problem:

With an MDB_RDONLY environment on Windows, env->me_mapsize
does not seem to affect the actual map size or vice versa.
mdb_env_map() does
		/* Don't set explicit map size, use whatever exists */

If the user sets a mapsize bigger than the current file,
and another process resizes the map and grows the DB into
the new size, then the RDONLY process will not discover
in mdb_txn_renew0() that its map is too small.

If there is a technical reason for the current behavior,
maybe it could create the full map (for the address space)
but record the smaller mapped size in MDB_env, and then
mdb_txn_renew0 could do some mutex-protected magic to
map in the new file segment if the file grew.  That
should avoid surprising the user.