diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2015-11-05 12:55:25 -0330 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2015-11-05 12:55:25 -0330 |
commit | a548114af8698b6ede6d3815ff51c9e4547cea29 (patch) | |
tree | a3bac345625ed559e3d361ddb12e0ab76f746fc5 /cpp/src | |
parent | IceGrid: catch LMDB exceptions on Database creation (diff) | |
download | ice-a548114af8698b6ede6d3815ff51c9e4547cea29.tar.bz2 ice-a548114af8698b6ede6d3815ff51c9e4547cea29.tar.xz ice-a548114af8698b6ede6d3815ff51c9e4547cea29.zip |
Added properties to set the database map size for IceGrid/IceStorm
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/PropertyNames.cpp | 3 | ||||
-rw-r--r-- | cpp/src/Ice/PropertyNames.h | 2 | ||||
-rw-r--r-- | cpp/src/IceDB/IceDB.cpp | 14 | ||||
-rw-r--r-- | cpp/src/IceGrid/Database.cpp | 5 | ||||
-rw-r--r-- | cpp/src/IceGrid/RegistryI.cpp | 1 | ||||
-rw-r--r-- | cpp/src/IceStorm/Instance.cpp | 3 | ||||
-rw-r--r-- | cpp/src/IceStorm/Service.cpp | 3 |
7 files changed, 24 insertions, 7 deletions
diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp index e305162c793..f4d74f3bc50 100644 --- a/cpp/src/Ice/PropertyNames.cpp +++ b/cpp/src/Ice/PropertyNames.cpp @@ -6,7 +6,7 @@ // ICE_LICENSE file included in this distribution. // // ********************************************************************** -// Generated by makeprops.py from file ../config/PropertyNames.xml, Fri Oct 30 11:31:45 2015 +// Generated by makeprops.py from file ../config/PropertyNames.xml, Thu Nov 5 12:25:50 2015 // IMPORTANT: Do not edit this file -- any edits made here will be lost! @@ -808,6 +808,7 @@ const IceInternal::Property IceGridPropsData[] = IceInternal::Property("IceGrid.Registry.Internal.ThreadPool.ThreadIdleTime", false, 0), IceInternal::Property("IceGrid.Registry.Internal.ThreadPool.ThreadPriority", false, 0), IceInternal::Property("IceGrid.Registry.Internal.MessageSizeMax", false, 0), + IceInternal::Property("IceGrid.Registry.LMDB.MapSize", false, 0), IceInternal::Property("IceGrid.Registry.NodeSessionTimeout", false, 0), IceInternal::Property("IceGrid.Registry.PermissionsVerifier.EndpointSelection", false, 0), IceInternal::Property("IceGrid.Registry.PermissionsVerifier.ConnectionCached", false, 0), diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h index 186b723777f..a3fb5aec422 100644 --- a/cpp/src/Ice/PropertyNames.h +++ b/cpp/src/Ice/PropertyNames.h @@ -6,7 +6,7 @@ // ICE_LICENSE file included in this distribution. // // ********************************************************************** -// Generated by makeprops.py from file ../config/PropertyNames.xml, Fri Oct 30 11:31:45 2015 +// Generated by makeprops.py from file ../config/PropertyNames.xml, Thu Nov 5 12:25:50 2015 // IMPORTANT: Do not edit this file -- any edits made here will be lost! diff --git a/cpp/src/IceDB/IceDB.cpp b/cpp/src/IceDB/IceDB.cpp index 78cb4b4dfc7..6db634ea9a3 100644 --- a/cpp/src/IceDB/IceDB.cpp +++ b/cpp/src/IceDB/IceDB.cpp @@ -159,6 +159,20 @@ Env::Env(const string& path, MDB_dbi maxDbs, size_t mapSize, unsigned int maxRea if(mapSize != 0) { + // Make sure the map size is a multiple of the page size + size_t pageSize; +#ifdef _WIN32 + SYSTEM_INFO si; + GetSystemInfo(&si); + pageSize = si.dwPageSize; +#else + pageSize = sysconf(_SC_PAGESIZE); +#endif + size_t remainder = mapSize % pageSize; + if(remainder != 0) + { + mapSize = mapSize + pageSize - remainder; + } rc = mdb_env_set_mapsize(_menv, mapSize); if(rc != MDB_SUCCESS) { diff --git a/cpp/src/IceGrid/Database.cpp b/cpp/src/IceGrid/Database.cpp index 8adffcc3f37..f1bb78bbd90 100644 --- a/cpp/src/IceGrid/Database.cpp +++ b/cpp/src/IceGrid/Database.cpp @@ -215,8 +215,9 @@ Database::Database(const Ice::ObjectAdapterPtr& registryAdapter, _objectCache(_communicator), _allocatableObjectCache(_communicator), _serverCache(_communicator, _instanceName, _nodeCache, _adapterCache, _objectCache, _allocatableObjectCache), - _dbLock(_communicator->getProperties()->getProperty("Registry.LMDB.Path") + "/icedb.lock"), - _env(_communicator->getProperties()->getProperty("Registry.LMDB.Path"), 8), + _dbLock(_communicator->getProperties()->getProperty("IceGrid.Registry.Data") + "/icedb.lock"), + _env(_communicator->getProperties()->getProperty("IceGrid.Registry.Data"), 8, + _communicator->getProperties()->getPropertyAsIntWithDefault("IceGrid.Registry.LMDB.MapSize", 100) *1024*1024), _pluginFacade(RegistryPluginFacadeIPtr::dynamicCast(getRegistryPluginFacade())), _lock(0) { diff --git a/cpp/src/IceGrid/RegistryI.cpp b/cpp/src/IceGrid/RegistryI.cpp index a7649c37c5a..ee099559b2e 100644 --- a/cpp/src/IceGrid/RegistryI.cpp +++ b/cpp/src/IceGrid/RegistryI.cpp @@ -341,7 +341,6 @@ RegistryI::startImpl() return false; } } - _communicator->getProperties()->setProperty("Registry.LMDB.Path", dbPath); // // Ensure that nothing is running on this port. This is also diff --git a/cpp/src/IceStorm/Instance.cpp b/cpp/src/IceStorm/Instance.cpp index 8674c057ba9..afdeec82db9 100644 --- a/cpp/src/IceStorm/Instance.cpp +++ b/cpp/src/IceStorm/Instance.cpp @@ -54,7 +54,8 @@ PersistentInstance::PersistentInstance( const NodePrx& nodeProxy) : Instance(instanceName, name, communicator, publishAdapter, topicAdapter, nodeAdapter, nodeProxy), _dbLock(communicator->getProperties()->getPropertyWithDefault(name + ".LMDB.Path", name) + "/icedb.lock"), - _dbEnv(communicator->getProperties()->getPropertyWithDefault(name + ".LMDB.Path", name), 2) + _dbEnv(communicator->getProperties()->getPropertyWithDefault(name + ".LMDB.Path", name), 2, + communicator->getProperties()->getPropertyAsIntWithDefault(name + ".LMDB.MapSize", 100) * 1024 * 1024) { try { diff --git a/cpp/src/IceStorm/Service.cpp b/cpp/src/IceStorm/Service.cpp index 06b371cf632..572c236694d 100644 --- a/cpp/src/IceStorm/Service.cpp +++ b/cpp/src/IceStorm/Service.cpp @@ -537,7 +537,8 @@ ServiceI::validateProperties(const string& name, const PropertiesPtr& properties "Trace.TopicManager", "Send.Timeout", "Discard.Interval", - "LMDB.Path" + "LMDB.Path", + "LMDB.MapSize" }; vector<string> unknownProps; |