[SERVER-62206] Remove DBClientBase::query_DEPRECATED() and migrate remaining callers Created: 21/Dec/21  Updated: 29/Oct/23  Resolved: 23/Jun/22

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

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:
Problem/Incident
causes SERVER-68007 Clonning phase of the movePrimary cmd... Closed
Related
is related to SERVER-67544 Coverity analysis defect 122382: Unin... Closed
is related to SERVER-59512 Introduce new find API to DBClientBas... Closed
is related to SERVER-61385 Migrate most callers of legacy 'DBCli... Closed
Backwards Compatibility: Fully Compatible
Sprint: QO 2022-02-07, QO 2022-02-21, QO 2022-03-07, QO 2022-03-21, QO 2022-04-04, QO 2022-04-18, QE 2022-05-02, QE 2022-05-16, QE 2022-05-30, QE 2022-06-13, QE 2022-06-27
Participants:

 Description   

This is follow-up work to related tickets SERVER-59512 and SERVER-61385. SERVER-59512 introduced DBClientBase::find() as a replacement for DBClientBase::query(). The essential difference between the two is that find() accepts a FindCommandRequest whereas query() accepted something resembling an OP_QUERY, even though the OP_QUERY find format was deprecated in 5.0 and removed in 5.1. SERVER-61385 renamed DBClientBase::query() to DBClientBase::query_DEPRECATED() and migrated almost all callers to DBClientBase::find().

The work for this ticket is to move all lingering remaining callers off DBClientBase::query_DEPRECATED() so that the old API can be deleted from the internal client code. There are three major categories of callers which must be dealt with:

  • Callers which run exhaust queries. The new find() API needs to be improved to support exhaust in order to allow these callers to be migrated.
  • Callers which rely on the DBClientCursorBatchIterator overload of query_DEPRECATED(). The callers either need to be refactored, or some equivalent of DBClientCursorBatchIterator needs to be introduced to the find() API.
  • Callers which still construct an OP_QUERY-style BSON payload, and need it to be parsed to a FindCommandRequest. In particular, this includes the code for dealing with the precondition of an applyOps command, and the call site for the shell in mozjs/mongo.cpp.


 Comments   
Comment by Githook User [ 22/Jun/22 ]

Author:

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

Message: SERVER-62206 Remove DBClientBase::query_DEPRECATED()

Also includes related simplifications to the implementation
of 'DBClientCursor'.
Branch: master
https://github.com/mongodb/mongo/commit/eb8e6a0a8f090d761fc8450670c7636d976effc7

Comment by Githook User [ 22/Jun/22 ]

Author:

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

Message: SERVER-62206 Accommodate deletion of DBClientCursorBatchIterator
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/a9710635755a1208cddf3a1f29870d464532d6be

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