summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRachita Dhawan <rachita.dhawan@gmail.com>2022-12-16 20:48:30 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-12-16 21:55:32 +0000
commitab506f144f44e24addaccbcb755b8d99e7ef29c3 (patch)
tree6611a1345ba2b9e97484239267423ff9df152d91 /src
parentc201da20671a73b78593ff4cf9b21fa04973004c (diff)
downloadmongo-ab506f144f44e24addaccbcb755b8d99e7ef29c3.tar.gz
SERVER-72046 Add test for concurrent migration fetching and insertion
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/s/sharding_runtime_d_params.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/s/sharding_runtime_d_params.h b/src/mongo/db/s/sharding_runtime_d_params.h
index dc02ef244a3..75d192665b2 100644
--- a/src/mongo/db/s/sharding_runtime_d_params.h
+++ b/src/mongo/db/s/sharding_runtime_d_params.h
@@ -31,6 +31,7 @@
#include "fmt/core.h"
#include "mongo/base/status.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/s/sharding_feature_flags_gen.h"
#include "mongo/util/processinfo.h"
@@ -44,7 +45,8 @@ inline Status validateMigrationConcurrency(const int& migrationConcurrency,
"concurrency feature flag"};
}
int maxConcurrency = ProcessInfo::getNumCores();
- if (migrationConcurrency <= 0 || migrationConcurrency > maxConcurrency) {
+ if (migrationConcurrency <= 0 ||
+ (migrationConcurrency > maxConcurrency && !getTestCommandsEnabled())) {
return Status{
ErrorCodes::InvalidOptions,
fmt::format(