summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/rollback_impl.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@mongodb.com>2021-12-21 11:15:42 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-12-21 11:55:50 +0000
commit19080405d9c7d08b54e70228a92d237223f2885c (patch)
tree73748cedfa62252c21968fdd4d0290972bbf3641 /src/mongo/db/repl/rollback_impl.cpp
parent58ca93e30a6436f47a8e8eaa3ddc831e376965dc (diff)
downloadmongo-19080405d9c7d08b54e70228a92d237223f2885c.tar.gz
SERVER-61385 Migrate callers of 'DBClientBase::query()' legacy API to the modern 'find()' API
There are a handful of remaining callers of the legacy API, either using the exhaust option or which are involved in a code path which still relies on the OP_QUERY-inspired BSON format. These should be cleaned up as follow-up work.
Diffstat (limited to 'src/mongo/db/repl/rollback_impl.cpp')
-rw-r--r--src/mongo/db/repl/rollback_impl.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mongo/db/repl/rollback_impl.cpp b/src/mongo/db/repl/rollback_impl.cpp
index a03e6793ea0..70d2bb88940 100644
--- a/src/mongo/db/repl/rollback_impl.cpp
+++ b/src/mongo/db/repl/rollback_impl.cpp
@@ -475,12 +475,13 @@ void RollbackImpl::_restoreTxnsTableEntryFromRetryableWrites(OperationContext* o
const auto filterFromMigration = BSON("op"
<< "n"
<< "fromMigrate" << true);
- auto cursor = client->query(
- NamespaceString::kRsOplogNamespace,
- BSON("ts" << BSON("$gt" << stableTimestamp) << "txnNumber" << BSON("$exists" << true)
- << "stmtId" << BSON("$exists" << true) << "prevOpTime.ts"
- << BSON("$gte" << Timestamp(1, 0) << "$lte" << stableTimestamp) << "$or"
- << BSON_ARRAY(filter << filterFromMigration)));
+ FindCommandRequest findRequest{NamespaceString::kRsOplogNamespace};
+ findRequest.setFilter(BSON("ts" << BSON("$gt" << stableTimestamp) << "txnNumber"
+ << BSON("$exists" << true) << "stmtId"
+ << BSON("$exists" << true) << "prevOpTime.ts"
+ << BSON("$gte" << Timestamp(1, 0) << "$lte" << stableTimestamp)
+ << "$or" << BSON_ARRAY(filter << filterFromMigration)));
+ auto cursor = client->find(std::move(findRequest));
while (cursor->more()) {
auto doc = cursor->next();
auto swEntry = OplogEntry::parse(doc);