diff options
author | William Schultz <william.schultz@mongodb.com> | 2017-05-17 12:09:23 -0400 |
---|---|---|
committer | William Schultz <william.schultz@mongodb.com> | 2017-06-02 17:32:23 -0400 |
commit | 40899230e7738ace3970255069da06bf89d34996 (patch) | |
tree | 0b7199aaad7ebc777d31ec575d41d9e4fc8cb4ac | |
parent | 8ae8ab867a077c3fa0b2c9ea4eaa864c0b76e213 (diff) | |
download | mongo-40899230e7738ace3970255069da06bf89d34996.tar.gz |
SERVER-28924 Change databasesCloner to use the 'nameOnly' version of listDatabases
(cherry picked from commit 222729e604843568bb7100be1d94b28853c2da8d)
-rw-r--r-- | src/mongo/db/repl/databases_cloner.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/repl/databases_cloner.cpp b/src/mongo/db/repl/databases_cloner.cpp index 9b8fcbeb568..4a18e1be1b8 100644 --- a/src/mongo/db/repl/databases_cloner.cpp +++ b/src/mongo/db/repl/databases_cloner.cpp @@ -200,10 +200,12 @@ Status DatabasesCloner::startup() noexcept { return _status; } - // Schedule listDatabase command which will kick off the database cloner per result db. + // Schedule listDatabase command which will kick off the database cloner per result db. We only + // retrieve database names since computing & fetching all database stats can be costly on the + // remote node when there are a large number of collections. Request listDBsReq(_source, "admin", - BSON("listDatabases" << true), + BSON("listDatabases" << true << "nameOnly" << true), rpc::ServerSelectionMetadata(true, boost::none).toBSON(), nullptr); _listDBsScheduler = stdx::make_unique<RemoteCommandRetryScheduler>( |