diff options
author | David Storch <david.storch@mongodb.com> | 2021-10-21 16:29:10 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-11-10 17:13:38 +0000 |
commit | 1b51a502f9201aacf760ba37b02888bbbff831da (patch) | |
tree | ce2ff376a49ae3738930f4ce42eb2fbb7036582c /src/mongo/db/ops | |
parent | b9dd38f987381211ca5217063c949638f028b592 (diff) | |
download | mongo-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/ops')
-rw-r--r-- | src/mongo/db/ops/write_ops_retryability.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/db/ops/write_ops_retryability.cpp b/src/mongo/db/ops/write_ops_retryability.cpp index 65fffa768d9..4cbc3a20366 100644 --- a/src/mongo/db/ops/write_ops_retryability.cpp +++ b/src/mongo/db/ops/write_ops_retryability.cpp @@ -118,8 +118,8 @@ BSONObj extractPreOrPostImage(OperationContext* opCtx, const repl::OplogEntry& o LogicalSessionId sessionId = oplog.getSessionId().get(); TxnNumber txnNumber = oplog.getTxnNumber().get(); Timestamp ts = oplog.getTimestamp(); - BSONObj imageDoc = client.findOne(NamespaceString::kConfigImagesNamespace.ns(), - BSON("_id" << sessionId.toBSON()) /*filter*/); + BSONObj imageDoc = client.findOne(NamespaceString::kConfigImagesNamespace, + BSON("_id" << sessionId.toBSON())); if (imageDoc.isEmpty()) { LOGV2_WARNING(5676402, "Image lookup for a retryable findAndModify was not found", @@ -170,8 +170,7 @@ BSONObj extractPreOrPostImage(OperationContext* opCtx, const repl::OplogEntry& o auto opTime = oplog.getPreImageOpTime() ? oplog.getPreImageOpTime().value() : oplog.getPostImageOpTime().value(); - auto oplogDoc = - client.findOne(NamespaceString::kRsOplogNamespace.ns(), opTime.asQuery(), Query(), nullptr); + auto oplogDoc = client.findOne(NamespaceString::kRsOplogNamespace, opTime.asQuery()); uassert(40613, str::stream() << "oplog no longer contains the complete write history of this " |