summaryrefslogtreecommitdiff
path: root/src/mongo/db/s
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>2023-01-19 01:52:53 +0000
commited1c0c635535b5ca7deda5ba3671ede2b1e2d59b (patch)
treef6c9e17e23b1460438d091e1395ed50594f3c086 /src/mongo/db/s
parentb5dda11fcdb180aecc11312db8059bd6ef9febec (diff)
downloadmongo-ed1c0c635535b5ca7deda5ba3671ede2b1e2d59b.tar.gz
SERVER-72046 Add test for concurrent migration fetching and insertion
(cherry picked from commit ab506f144f44e24addaccbcb755b8d99e7ef29c3)
Diffstat (limited to 'src/mongo/db/s')
-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 190e442a5fb..00dd1fddfed 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"
@@ -43,7 +44,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(