summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Grundy <michael.grundy@10gen.com>2016-06-10 17:21:19 -0400
committerMike Grundy <michael.grundy@10gen.com>2016-06-16 14:54:41 -0400
commitf353b945a5fb1e02fa27818dcde89e658f16a91f (patch)
treee5647f88b7e202ee8f5354d5d2a85320dd5a6291
parent6c50da2919703033ccb29f23389dcfd8ca62ad08 (diff)
downloadmongo-f353b945a5fb1e02fa27818dcde89e658f16a91f.tar.gz
SERVER-22204 Tests should lower WT cache size
(cherry picked from commit dd3d9e3077094a7a19943c8973175725276348db) Conflicts: etc/evergreen.yml src/mongo/shell/utils.js
-rw-r--r--buildscripts/resmokelib/config.py5
-rw-r--r--buildscripts/resmokelib/core/programs.py2
-rw-r--r--buildscripts/resmokelib/parser.py6
-rw-r--r--etc/evergreen.yml5
-rw-r--r--src/mongo/shell/servers.js4
-rw-r--r--src/mongo/shell/utils.js1
6 files changed, 23 insertions, 0 deletions
diff --git a/buildscripts/resmokelib/config.py b/buildscripts/resmokelib/config.py
index d19ca0181df..3f76798fa9b 100644
--- a/buildscripts/resmokelib/config.py
+++ b/buildscripts/resmokelib/config.py
@@ -57,6 +57,7 @@ DEFAULTS = {
"shellWriteMode": None,
"shuffle": False,
"storageEngine": None,
+ "storageEngineCacheSizeGB": None,
"wiredTigerCollectionConfigString": None,
"wiredTigerEngineConfigString": None,
"wiredTigerIndexConfigString": None
@@ -153,6 +154,10 @@ SHUFFLE = None
STORAGE_ENGINE = None
# If set, then all mongod's started by resmoke.py and by the mongo shell will use the specified
+# storage engine cache size.
+STORAGE_ENGINE_CACHE_SIZE = None
+
+# If set, then all mongod's started by resmoke.py and by the mongo shell will use the specified
# WiredTiger collection configuration settings.
WT_COLL_CONFIG = None
diff --git a/buildscripts/resmokelib/core/programs.py b/buildscripts/resmokelib/core/programs.py
index 4d204579a06..fc9e65a9610 100644
--- a/buildscripts/resmokelib/core/programs.py
+++ b/buildscripts/resmokelib/core/programs.py
@@ -38,6 +38,7 @@ def mongod_program(logger, executable=None, process_kwargs=None, **kwargs):
"nojournal": config.NO_JOURNAL,
"nopreallocj": config.NO_PREALLOC_JOURNAL,
"storageEngine": config.STORAGE_ENGINE,
+ "wiredTigerCacheSizeGB": config.STORAGE_ENGINE_CACHE_SIZE,
"wiredTigerCollectionConfigString": config.WT_COLL_CONFIG,
"wiredTigerEngineConfigString": config.WT_ENGINE_CONFIG,
"wiredTigerIndexConfigString": config.WT_INDEX_CONFIG,
@@ -126,6 +127,7 @@ def mongo_shell_program(logger, executable=None, filename=None, process_kwargs=N
"noJournal": (config.NO_JOURNAL, False),
"noJournalPrealloc": (config.NO_PREALLOC_JOURNAL, False),
"storageEngine": (config.STORAGE_ENGINE, ""),
+ "storageEngineCacheSizeGB": (config.STORAGE_ENGINE_CACHE_SIZE, ""),
"testName": (os.path.splitext(os.path.basename(filename))[0], ""),
"wiredTigerCollectionConfigString": (config.WT_COLL_CONFIG, ""),
"wiredTigerEngineConfigString": (config.WT_ENGINE_CONFIG, ""),
diff --git a/buildscripts/resmokelib/parser.py b/buildscripts/resmokelib/parser.py
index c170e4c218d..287995cfe8c 100644
--- a/buildscripts/resmokelib/parser.py
+++ b/buildscripts/resmokelib/parser.py
@@ -42,6 +42,7 @@ DEST_TO_CONFIG = {
"shell_write_mode": "shellWriteMode",
"shuffle": "shuffle",
"storage_engine": "storageEngine",
+ "storage_engine_cache_size": "storageEngineCacheSizeGB",
"wt_coll_config": "wiredTigerCollectionConfigString",
"wt_engine_config": "wiredTigerEngineConfigString",
"wt_index_config": "wiredTigerIndexConfigString"
@@ -183,6 +184,10 @@ def parse_command_line():
parser.add_option("--storageEngine", dest="storage_engine", metavar="ENGINE",
help="The storage engine used by dbtests and jstests.")
+ parser.add_option("--storageEngineCacheSizeGB", dest="storage_engine_cache_size",
+ metavar="CONFIG", help="Set the storage engine cache size configuration"
+ " setting for all mongod's.")
+
parser.add_option("--wiredTigerCollectionConfigString", dest="wt_coll_config", metavar="CONFIG",
help="Set the WiredTiger collection configuration setting for all mongod's.")
@@ -244,6 +249,7 @@ def update_config_vars(values):
_config.SHELL_WRITE_MODE = config.pop("shellWriteMode")
_config.SHUFFLE = config.pop("shuffle")
_config.STORAGE_ENGINE = config.pop("storageEngine")
+ _config.STORAGE_ENGINE_CACHE_SIZE = config.pop("storageEngineCacheSizeGB")
_config.WT_COLL_CONFIG = config.pop("wiredTigerCollectionConfigString")
_config.WT_ENGINE_CONFIG = config.pop("wiredTigerEngineConfigString")
_config.WT_INDEX_CONFIG = config.pop("wiredTigerIndexConfigString")
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index cc81740115e..95e1ddff1c0 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -306,6 +306,11 @@ functions:
extra_args="$extra_args --continueOnFailure"
fi
+ # Default storageEngineCacheSizeGB to 1. Override on individual test config if needed.
+ if [[ "${resmoke_args}" = *storageEngine=wiredTiger* ]] && [[ "${resmoke_args}" != *storageEngineCacheSizeGB* ]]; then
+ extra_args="$extra_args --storageEngineCacheSizeGB=1"
+ fi
+
${path_prefix} ${asan_symbolizer} ${enable_lsan} ${rlp_environment} ${python|python} buildscripts/resmoke.py ${resmoke_args} $extra_args ${test_flags} --log=buildlogger --reportFile=report.json
"run jstestfuzz":
diff --git a/src/mongo/shell/servers.js b/src/mongo/shell/servers.js
index 81f39701e9c..85d50384202 100644
--- a/src/mongo/shell/servers.js
+++ b/src/mongo/shell/servers.js
@@ -919,6 +919,10 @@ var MongoRunner, _startMongod, startMongoProgram, runMongoProgram, startMongoPro
argArray.push(...['--storageEngine', jsTest.options().storageEngine]);
}
}
+ if (jsTest.options().storageEngineCacheSizeGB) {
+ argArray.push(
+ ...['--wiredTigerCacheSizeGB', jsTest.options().storageEngineCacheSizeGB]);
+ }
if (jsTest.options().wiredTigerEngineConfigString) {
argArray.push(...[
'--wiredTigerEngineConfigString',
diff --git a/src/mongo/shell/utils.js b/src/mongo/shell/utils.js
index 26b2cb5cdf6..b296cb9a048 100644
--- a/src/mongo/shell/utils.js
+++ b/src/mongo/shell/utils.js
@@ -193,6 +193,7 @@ jsTestOptions = function() {
setParameters: TestData.setParameters,
setParametersMongos: TestData.setParametersMongos,
storageEngine: TestData.storageEngine,
+ storageEngineCacheSizeGB: TestData.storageEngineCacheSizeGB,
wiredTigerEngineConfigString: TestData.wiredTigerEngineConfigString,
wiredTigerCollectionConfigString: TestData.wiredTigerCollectionConfigString,
wiredTigerIndexConfigString: TestData.wiredTigerIndexConfigString,