Skip to content

Commit 776c385

Browse files
committed
SERVER-42516 Remove FCV check for readOnce flag in collection cloner
1 parent b92fbdf commit 776c385

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/mongo/db/repl/collection_cloner.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -537,18 +537,13 @@ void CollectionCloner::_runQuery(const executor::TaskExecutor::CallbackArgs& cal
537537
return;
538538
}
539539

540-
// readOnce is available on 4.2 sync sources only. Initially we don't know FCV, so
541-
// we won't use the readOnce feature, but once the admin database is cloned we will use it.
542-
// The admin database is always cloned first, so all user data should use readOnce.
543-
const bool readOnceAvailable = serverGlobalParams.featureCompatibility.getVersionUnsafe() ==
544-
ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo42;
545540
try {
546541
_clientConnection->query(
547542
[this, onCompletionGuard](DBClientCursorBatchIterator& iter) {
548543
_handleNextBatch(onCompletionGuard, iter);
549544
},
550545
NamespaceStringOrUUID(_sourceNss.db().toString(), *_options.uuid),
551-
readOnceAvailable ? QUERY("query" << BSONObj() << "$readOnce" << true) : Query(),
546+
QUERY("query" << BSONObj() << "$readOnce" << true),
552547
nullptr /* fieldsToReturn */,
553548
QueryOption_NoCursorTimeout | QueryOption_SlaveOk |
554549
(collectionClonerUsesExhaust ? QueryOption_Exhaust : 0),

0 commit comments

Comments
 (0)