summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2019-12-13 14:21:47 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-10 20:11:37 +0000
commit0be749a16f4523b2a23729e0754a89ba5ea99644 (patch)
tree98194efe8e28ab43e1b7f8079ae663ba711d5d7f
parent441a9e20db23a7906981085a56d85b14c1972967 (diff)
downloadmongo-0be749a16f4523b2a23729e0754a89ba5ea99644.tar.gz
SERVER-44984 reduce index build thread pool default and index build external sort memory limit default
In addition, this commit turns on two-phase index building for some remaining concurrency suites, as the suites do not pass in one-phase mode with the smaller thread pool size.
-rw-r--r--etc/evergreen.yml14
-rw-r--r--src/mongo/db/catalog/multi_index_block.idl6
-rw-r--r--src/mongo/db/index_builds_coordinator_mongod.cpp6
-rw-r--r--src/mongo/db/index_builds_coordinator_mongod.h1
-rw-r--r--src/mongo/db/index_builds_coordinator_mongod_test.cpp10
5 files changed, 20 insertions, 17 deletions
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index 92f572029cf..d1314b6f291 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -5112,12 +5112,10 @@ tasks:
num_tasks: 10
jstestfuzz_vars: --jsTestsDir ../jstests
suite: jstestfuzz_sharded_continuous_stepdown
- # TODO(SERVER-44896): Remove enableTwoPhaseIndexBuild from server parameters when two phase
- # index builds work with this flow control setting.
resmoke_args: >-
--flowControlTicketOverride=3
--storageEngine=wiredTiger
- --mongodSetParameters="{logComponentVerbosity: {command: 2}, enableTwoPhaseIndexBuild: false}"
+ --mongodSetParameters="{logComponentVerbosity: {command: 2}}"
name: jstestfuzz_sharded_continuous_stepdown_flow_control
## jstestfuzz concurrent sharded cluster continuous stepdown with flow control engaged ##
@@ -5132,13 +5130,10 @@ tasks:
num_tasks: 2
jstestfuzz_vars: --jsTestsDir ../jstests
suite: jstestfuzz_sharded_continuous_stepdown
- # TODO(SERVER-44896): Remove enableTwoPhaseIndexBuild from server parameters when two phase
- # index builds work with this flow control setting.
resmoke_args: >-
--flowControlTicketOverride=30
--storageEngine=wiredTiger
--numClientsPerFixture=10
- --mongodSetParameters="{enableTwoPhaseIndexBuild: false}"
name: jstestfuzz_concurrent_sharded_continuous_stepdown_flow_control
# jstestfuzz replication continuous stepdown with flow control engaged #
@@ -5153,12 +5148,10 @@ tasks:
num_tasks: 30
jstestfuzz_vars: --jsTestsDir ../jstests
suite: jstestfuzz_replication_continuous_stepdown
- # TODO(SERVER-44896): Remove enableTwoPhaseIndexBuild from server parameters when two phase
- # index builds work with this flow control setting.
resmoke_args: >-
--flowControlTicketOverride=1
--storageEngine=wiredTiger
- --mongodSetParameters="{logComponentVerbosity: {command: 2}, enableTwoPhaseIndexBuild: false}"
+ --mongodSetParameters="{logComponentVerbosity: {command: 2}}"
name: jstestfuzz_replication_continuous_stepdown_flow_control
## jstestfuzz concurrent replication continuous stepdown with flow control engaged ##
@@ -5173,13 +5166,10 @@ tasks:
num_tasks: 15
jstestfuzz_vars: --jsTestsDir ../jstests
suite: jstestfuzz_replication_continuous_stepdown
- # TODO(SERVER-44896): Remove enableTwoPhaseIndexBuild from server parameters when two phase
- # index builds work with this flow control setting.
resmoke_args: >-
--flowControlTicketOverride=10
--storageEngine=wiredTiger
--numClientsPerFixture=10
- --mongodSetParameters="{enableTwoPhaseIndexBuild: false}"
name: jstestfuzz_concurrent_replication_continuous_stepdown_flow_control
## jstestfuzz replica set ##
diff --git a/src/mongo/db/catalog/multi_index_block.idl b/src/mongo/db/catalog/multi_index_block.idl
index 08b183e3560..311a7f701f1 100644
--- a/src/mongo/db/catalog/multi_index_block.idl
+++ b/src/mongo/db/catalog/multi_index_block.idl
@@ -52,12 +52,12 @@ server_parameters:
default: true
maxIndexBuildMemoryUsageMegabytes:
- description: "Limits the amount of memory that simultaneous foreground index builds on one collection may consume for the duration of the builds"
+ description: "Limits the amount of memory that simultaneous index builds on one collection may consume for the duration of the builds"
set_at:
- runtime
- startup
cpp_varname: maxIndexBuildMemoryUsageMegabytes
cpp_vartype: AtomicWord<int>
- default: 500
+ default: 200
validator:
- gte: 100
+ gte: 50
diff --git a/src/mongo/db/index_builds_coordinator_mongod.cpp b/src/mongo/db/index_builds_coordinator_mongod.cpp
index cc915a7a6c3..9bd0f46bfb9 100644
--- a/src/mongo/db/index_builds_coordinator_mongod.cpp
+++ b/src/mongo/db/index_builds_coordinator_mongod.cpp
@@ -64,7 +64,7 @@ ThreadPool::Options makeDefaultThreadPoolOptions() {
// We depend on thread pool sizes being equal between primaries and secondaries. If a secondary
// has fewer resources than a primary, index build oplog entries can replicate in an order that
// the secondary is unable to fulfill, leading to deadlocks. See SERVER-44250.
- options.maxThreads = 10;
+ options.maxThreads = 3;
// Ensure all threads have a client.
options.onCreateThread = [](const std::string& threadName) {
@@ -80,6 +80,10 @@ IndexBuildsCoordinatorMongod::IndexBuildsCoordinatorMongod()
: _threadPool(makeDefaultThreadPoolOptions()) {
_threadPool.startup();
}
+IndexBuildsCoordinatorMongod::IndexBuildsCoordinatorMongod(ThreadPool::Options options)
+ : _threadPool(std::move(options)) {
+ _threadPool.startup();
+}
void IndexBuildsCoordinatorMongod::shutdown() {
// Stop new scheduling.
diff --git a/src/mongo/db/index_builds_coordinator_mongod.h b/src/mongo/db/index_builds_coordinator_mongod.h
index 20691de7751..e9569621d5e 100644
--- a/src/mongo/db/index_builds_coordinator_mongod.h
+++ b/src/mongo/db/index_builds_coordinator_mongod.h
@@ -55,6 +55,7 @@ public:
* Sets up the thread pool.
*/
IndexBuildsCoordinatorMongod();
+ IndexBuildsCoordinatorMongod(ThreadPool::Options options);
/**
* Shuts down the thread pool, signals interrupt to all index builds, then waits for all of the
diff --git a/src/mongo/db/index_builds_coordinator_mongod_test.cpp b/src/mongo/db/index_builds_coordinator_mongod_test.cpp
index 8a9939579b4..64cf3c8c487 100644
--- a/src/mongo/db/index_builds_coordinator_mongod_test.cpp
+++ b/src/mongo/db/index_builds_coordinator_mongod_test.cpp
@@ -73,7 +73,15 @@ void IndexBuildsCoordinatorMongodTest::setUp() {
createCollection(_testFooNss, _testFooUUID);
createCollection(_testBarNss, _testBarUUID);
createCollection(_othertestFooNss, _othertestFooUUID);
- _indexBuildsCoord = std::make_unique<IndexBuildsCoordinatorMongod>();
+
+ ThreadPool::Options options;
+ options.poolName = "IndexBuildsCoordinatorMongod";
+ options.minThreads = 0;
+ options.maxThreads = 5;
+ options.onCreateThread = [](const std::string& threadName) {
+ Client::initThread(threadName.c_str());
+ };
+ _indexBuildsCoord = std::make_unique<IndexBuildsCoordinatorMongod>(options);
}
void IndexBuildsCoordinatorMongodTest::tearDown() {