diff options
author | Eric Milkie <milkie@mongodb.com> | 2019-12-30 20:05:36 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-12-30 20:05:36 +0000 |
commit | 65b13aa0a585a7b1630faca5c6f3a1895853a35d (patch) | |
tree | 47fd0d78396665c2cae07336fff76a4dd06d01a7 /src/mongo/db/storage | |
parent | c184d4e59b059f0a2bec164e93742231a004e346 (diff) | |
download | mongo-65b13aa0a585a7b1630faca5c6f3a1895853a35d.tar.gz |
SERVER-45288 switch Idempotency tests to use WiredTiger instead of ephemeralForTest
This reverts commit 04bbe5f2abf8945330a26d50257eb0a550f32af1.
Diffstat (limited to 'src/mongo/db/storage')
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp | 12 | ||||
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp | 16 | ||||
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h | 5 |
3 files changed, 18 insertions, 15 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp index ee9c8ea6027..ec034eccc34 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp @@ -130,21 +130,9 @@ public: MONGO_COMPILER_VARIABLE_UNUSED auto leakedSection = new WiredTigerServerStatusSection(kv); - auto* param = new WiredTigerEngineRuntimeConfigParameter( - "wiredTigerEngineRuntimeConfig", ServerParameterType::kRuntimeOnly); - param->_data.second = kv; - - auto* maxCacheOverflowParam = new WiredTigerMaxCacheOverflowSizeGBParameter( - "wiredTigerMaxCacheOverflowSizeGB", ServerParameterType::kRuntimeOnly); - maxCacheOverflowParam->_data = {wiredTigerGlobalOptions.maxCacheOverflowFileSizeGB, kv}; - // This allows unit tests to run this code without encountering memory leaks - // TODO (SERVER-43063): to fix the global server parameter registry memory leak. The - // server status section leak will still exist after SERVER-43063. #if __has_feature(address_sanitizer) __lsan_ignore_object(leakedSection); - __lsan_ignore_object(param); - __lsan_ignore_object(maxCacheOverflowParam); #endif } diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp index 2013e2fed91..dd63aad920a 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp @@ -797,12 +797,22 @@ WiredTigerKVEngine::WiredTigerKVEngine(const std::string& canonicalName, _sizeStorer = std::make_unique<WiredTigerSizeStorer>(_conn, _sizeStorerUri, _readOnly); Locker::setGlobalThrottling(&openReadTransaction, &openWriteTransaction); + + _runTimeConfigParam.reset(new WiredTigerEngineRuntimeConfigParameter( + "wiredTigerEngineRuntimeConfig", ServerParameterType::kRuntimeOnly)); + _runTimeConfigParam->_data.second = this; + _maxCacheOverflowParam.reset(new WiredTigerMaxCacheOverflowSizeGBParameter( + "wiredTigerMaxCacheOverflowSizeGB", ServerParameterType::kRuntimeOnly)); + _maxCacheOverflowParam->_data = {maxCacheOverflowFileSizeMB / 1024, this}; } WiredTigerKVEngine::~WiredTigerKVEngine() { - if (_conn) { - cleanShutdown(); - } + // Remove server parameters that we added in the constructor, to enable unit tests to reload the + // storage engine again in this same process. + ServerParameterSet::getGlobal()->remove("wiredTigerEngineRuntimeConfig"); + ServerParameterSet::getGlobal()->remove("wiredTigerMaxCacheOverflowSizeGB"); + + cleanShutdown(); _sessionCache.reset(nullptr); } diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h index 8c0eb10d8f8..ca4c51c1ccd 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h @@ -55,6 +55,8 @@ class JournalListener; class WiredTigerRecordStore; class WiredTigerSessionCache; class WiredTigerSizeStorer; +class WiredTigerEngineRuntimeConfigParameter; +class WiredTigerMaxCacheOverflowSizeGBParameter; struct WiredTigerFileVersion { enum class StartupVersion { IS_34, IS_36, IS_40, IS_42, IS_44 }; @@ -490,5 +492,8 @@ private: // // Access must be protected by the CheckpointLock. std::list<std::string> _checkpointedIndexes; + + std::unique_ptr<WiredTigerEngineRuntimeConfigParameter> _runTimeConfigParam; + std::unique_ptr<WiredTigerMaxCacheOverflowSizeGBParameter> _maxCacheOverflowParam; }; } // namespace mongo |