diff options
author | Jack Mulrow <jack.mulrow@mongodb.com> | 2020-01-21 20:50:37 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2020-01-21 20:50:37 +0000 |
commit | 9c638e3cb001a4dc9fcf869d2602c504439c2aef (patch) | |
tree | 5e9ad8f321c148607968b980daca2233af5b0e53 /src/mongo/db/s | |
parent | 685afc7262c35f71cc04ceb0819a3a90f06c95bb (diff) | |
download | mongo-9c638e3cb001a4dc9fcf869d2602c504439c2aef.tar.gz |
SERVER-43832 Expose readConcern and writeConcern defaults in serverStatus
Diffstat (limited to 'src/mongo/db/s')
-rw-r--r-- | src/mongo/db/s/SConscript | 1 | ||||
-rw-r--r-- | src/mongo/db/s/balancer/migration_manager_test.cpp | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/s/SConscript b/src/mongo/db/s/SConscript index 823a76b04a2..029f80d5451 100644 --- a/src/mongo/db/s/SConscript +++ b/src/mongo/db/s/SConscript @@ -359,6 +359,7 @@ env.CppUnitTest( ], LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/authmocks', + '$BUILD_DIR/mongo/db/read_write_concern_defaults_mock', '$BUILD_DIR/mongo/db/repl/replication_info', '$BUILD_DIR/mongo/s/config_server_test_fixture', '$BUILD_DIR/mongo/util/version_impl', diff --git a/src/mongo/db/s/balancer/migration_manager_test.cpp b/src/mongo/db/s/balancer/migration_manager_test.cpp index 74c6e0168a1..c0d4032034d 100644 --- a/src/mongo/db/s/balancer/migration_manager_test.cpp +++ b/src/mongo/db/s/balancer/migration_manager_test.cpp @@ -32,6 +32,8 @@ #include <memory> #include "mongo/db/commands.h" +#include "mongo/db/read_write_concern_defaults.h" +#include "mongo/db/read_write_concern_defaults_cache_lookup_mock.h" #include "mongo/db/s/balancer/migration_manager.h" #include "mongo/db/s/balancer/migration_test_fixture.h" #include "mongo/db/s/config/sharding_catalog_manager.h" @@ -50,6 +52,10 @@ protected: _migrationManager = std::make_unique<MigrationManager>(getServiceContext()); _migrationManager->startRecoveryAndAcquireDistLocks(operationContext()); _migrationManager->finishRecovery(operationContext(), 0, kDefaultSecondaryThrottle); + + // Necessary because the migration manager may take a dist lock, which calls serverStatus + // and will attempt to return the latest read write concern defaults. + ReadWriteConcernDefaults::create(getServiceContext(), _lookupMock.getFetchDefaultsFn()); } void tearDown() override { @@ -95,6 +101,7 @@ protected: } std::unique_ptr<MigrationManager> _migrationManager; + ReadWriteConcernDefaultsLookupMock _lookupMock; }; TEST_F(MigrationManagerTest, OneCollectionTwoMigrations) { |