summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/session_catalog_migration_source.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@mongodb.com>2021-10-21 16:29:10 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-11-10 17:13:38 +0000
commit1b51a502f9201aacf760ba37b02888bbbff831da (patch)
treece2ff376a49ae3738930f4ce42eb2fbb7036582c /src/mongo/db/s/session_catalog_migration_source.cpp
parentb9dd38f987381211ca5217063c949638f028b592 (diff)
downloadmongo-1b51a502f9201aacf760ba37b02888bbbff831da.tar.gz
SERVER-59512 add new, cleaner query interface to DBClientBase
The new interface uses FindCommandRequest, and avoids any characteristics that relate specifically to the no-longer-supported OP_QUERY wire protocol message. This patch moves all callers of 'findOne()' onto the new API, but more work is required to fully eliminate the old 'query()' API from DBClientBase.
Diffstat (limited to 'src/mongo/db/s/session_catalog_migration_source.cpp')
-rw-r--r--src/mongo/db/s/session_catalog_migration_source.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mongo/db/s/session_catalog_migration_source.cpp b/src/mongo/db/s/session_catalog_migration_source.cpp
index 2981f132087..31f006da764 100644
--- a/src/mongo/db/s/session_catalog_migration_source.cpp
+++ b/src/mongo/db/s/session_catalog_migration_source.cpp
@@ -61,10 +61,8 @@ boost::optional<repl::OplogEntry> forgeNoopEntryFromImageCollection(
DBDirectClient client(opCtx);
BSONObj imageObj =
- client.findOne(NamespaceString::kConfigImagesNamespace.ns(),
- BSON("_id" << retryableFindAndModifyOplogEntry.getSessionId()->toBSON()),
- Query(),
- nullptr);
+ client.findOne(NamespaceString::kConfigImagesNamespace,
+ BSON("_id" << retryableFindAndModifyOplogEntry.getSessionId()->toBSON()));
if (imageObj.isEmpty()) {
return boost::none;
}
@@ -124,8 +122,7 @@ boost::optional<repl::OplogEntry> fetchPrePostImageOplog(OperationContext* opCtx
auto opTime = opTimeToFetch.value();
DBDirectClient client(opCtx);
- auto oplogBSON =
- client.findOne(NamespaceString::kRsOplogNamespace.ns(), opTime.asQuery(), Query(), nullptr);
+ auto oplogBSON = client.findOne(NamespaceString::kRsOplogNamespace, opTime.asQuery());
return uassertStatusOK(repl::OplogEntry::parse(oplogBSON));
}
@@ -437,8 +434,8 @@ bool SessionCatalogMigrationSource::_fetchNextNewWriteOplog(OperationContext* op
}
DBDirectClient client(opCtx);
- const auto& newWriteOplogDoc = client.findOne(
- NamespaceString::kRsOplogNamespace.ns(), nextOpTimeToFetch.asQuery(), Query(), nullptr);
+ const auto& newWriteOplogDoc =
+ client.findOne(NamespaceString::kRsOplogNamespace, nextOpTimeToFetch.asQuery());
uassert(40620,
str::stream() << "Unable to fetch oplog entry with opTime: "