summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLingzhi Deng <lingzhi.deng@mongodb.com>2020-04-22 15:41:26 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-23 14:17:43 +0000
commit578e8b9e39048c6bf7b47846603b246abc007adc (patch)
tree76f2989b47976c92f7ac81387c7171682ee0c180
parent8210db607c1e9c9f6e675d425c29f3b93c9f36f3 (diff)
downloadmongo-578e8b9e39048c6bf7b47846603b246abc007adc.tar.gz
SERVER-47056: Do not use readOnce cursors for collection scan in initial sync
-rw-r--r--src/mongo/db/repl/collection_cloner.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/mongo/db/repl/collection_cloner.cpp b/src/mongo/db/repl/collection_cloner.cpp
index a19c1c694d3..80efca4571e 100644
--- a/src/mongo/db/repl/collection_cloner.cpp
+++ b/src/mongo/db/repl/collection_cloner.cpp
@@ -543,18 +543,13 @@ void CollectionCloner::_runQuery(const executor::TaskExecutor::CallbackArgs& cal
return;
}
- // readOnce is available on 4.2 sync sources only. Initially we don't know FCV, so
- // we won't use the readOnce feature, but once the admin database is cloned we will use it.
- // The admin database is always cloned first, so all user data should use readOnce.
- const bool readOnceAvailable = serverGlobalParams.featureCompatibility.getVersionUnsafe() ==
- ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo42;
try {
_clientConnection->query(
[this, onCompletionGuard](DBClientCursorBatchIterator& iter) {
_handleNextBatch(onCompletionGuard, iter);
},
NamespaceStringOrUUID(_sourceNss.db().toString(), *_options.uuid),
- readOnceAvailable ? QUERY("query" << BSONObj() << "$readOnce" << true) : Query(),
+ Query(),
nullptr /* fieldsToReturn */,
QueryOption_NoCursorTimeout | QueryOption_SlaveOk |
(collectionClonerUsesExhaust ? QueryOption_Exhaust : 0),