MDB_NORDAHEAD option added to env (#1421)

This commit is contained in:
Russel Waters 2019-01-16 10:01:18 -05:00 committed by Roy Keene
commit 572cf5c65a

View file

@ -25,7 +25,8 @@ nano::mdb_env::mdb_env (bool & error_a, boost::filesystem::path const & path_a,
release_assert (status3 == 0);
// It seems if there's ever more threads than mdb_env_set_maxreaders has read slots available, we get failures on transaction creation unless MDB_NOTLS is specified
// This can happen if something like 256 io_threads are specified in the node config
auto status4 (mdb_env_open (environment, path_a.string ().c_str (), MDB_NOSUBDIR | MDB_NOTLS, 00600));
// MDB_NORDAHEAD will allow platforms that support it to load the DB in memory as needed.
auto status4 (mdb_env_open (environment, path_a.string ().c_str (), MDB_NOSUBDIR | MDB_NOTLS | MDB_NORDAHEAD, 00600));
release_assert (status4 == 0);
error_a = status4 != 0;
}