[SERVER-61385] Migrate most callers of legacy 'DBClientBase::query()' API to modern 'find()' API Created: 10/Nov/21  Updated: 29/Oct/23  Resolved: 21/Dec/21

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: None
Fix Version/s: 5.3.0

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: David Storch
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-62206 Remove DBClientBase::query_DEPRECATED... Closed
related to SERVER-62231 Methods for iterating a DBClientCurso... Closed
is related to SERVER-59512 Introduce new find API to DBClientBas... Closed
Backwards Compatibility: Fully Compatible
Sprint: QE 2021-11-29, QE 2021-12-13, QE 2021-12-27
Participants:
Linked BF Score: 64

 Description   

Related ticket SERVER-59512 recently introduced a new API to DBClientBase for performing find operations. This API accepts a FindCommandRequest, in contrast to the legacy DBClientBase::query() overloads. The legacy DBClientBase::query() API requires the caller to specify the find operation as though it were an OP_QUERY find. This is undesirable because the system no longer supports OP_QUERY find. Therefore, the internal client code is required to upconvert the OP_QUERY find description into an OP_MSG find command before actually sending it over the wire.

The goal of this ticket is to move callers of the legacy DBClientBase::query() API onto the new DBClientBase::find() API. Once this migration is complete, the code which implements DBClientBase::query(), including the special upconversion logic mentioned above, should be deleted. This may need to be done in multiple steps, depending on the complexity and the scope of the code changes.



 Comments   
Comment by Githook User [ 23/Dec/21 ]

Author:

{'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}

Message: SERVER-61385 Fix initialization of cursor in RollbackSourceImpl::findOneByUUID()
Branch: master
https://github.com/mongodb/mongo/commit/b4b899f9b295b976f8a360c07cd6eba6d507d7ec

Comment by David Storch [ 21/Dec/21 ]

Due to the scope of the changes required to fully eliminate the legacy DBClientBase::query() API from the code base, we now intend to do it in two steps. The changes committed under this ticket moved most but not all callers to the new API. It also renamed the old API to query_DEPRECATED() in order to discourage adding more uses in the future. I've filed followup ticket SERVER-62206 to complete the deletion of the legacy API, and retitled this ticket accordingly.

Comment by Githook User [ 21/Dec/21 ]

Author:

{'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}

Message: 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.
Branch: master
https://github.com/mongodb/mongo/commit/19080405d9c7d08b54e70228a92d237223f2885c

Generated at Thu Feb 08 05:52:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.