diff options
Diffstat (limited to 'src/mongo/db/global_environment_d.cpp')
-rw-r--r-- | src/mongo/db/global_environment_d.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/db/global_environment_d.cpp b/src/mongo/db/global_environment_d.cpp index 182811c7edd..eb85f6f78d4 100644 --- a/src/mongo/db/global_environment_d.cpp +++ b/src/mongo/db/global_environment_d.cpp @@ -95,10 +95,12 @@ namespace mongo { << "This may prevent the current storage engine " << name << " from starting up."; } + uassertStatusOK(_lockFile->open()); ScopeGuard guard = MakeGuard(&StorageEngineLockFile::close, _lockFile.get()); _storageEngine = factory->create(storageGlobalParams, *_lockFile); _storageEngine->finishInit(); + uassertStatusOK(_lockFile->writePid()); // Write a new metadata file if it is not present. StorageEngineMetadata::updateIfMissing(storageGlobalParams.dbpath, canonicalName); @@ -110,6 +112,7 @@ namespace mongo { invariant(_storageEngine); invariant(_lockFile.get()); _storageEngine->cleanShutdown(); + _lockFile->clearPidAndUnlock(); } void GlobalEnvironmentMongoD::registerStorageEngine(const std::string& name, |