[CDRIVER-3032] Audit how options are applied in cursor returning functions Created: 20/Mar/19  Updated: 10/Feb/23

Status: Backlog
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Kevin Albertson Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-3031 Support options from mongoc_query_fla... Backlog
is related to CDRIVER-2960 Use IDL for functions that create a c... Backlog
is related to CDRIVER-3030 Use the IDL to parse options for aggr... Closed
Epic Link: CDRIVER-4577

 Description   

Public functions that create a cursor (like mongoc_collection_find_with_opts) have one way to specify options, through a bson_t opts.

There are multiple ways bson options are handled when a cursor is returned:

  • driver specific options, like "serverId" never get sent to the server
  • options specific to the initial command (e.g. "bypassDocumentValidation") apply to the initial command, but not to getMore
  • options like "batchSize" apply to both the initial command and the getMore
  • options like "maxAwaitTimeMS" may trigger "maxTimeMS" being set on the getMore

We've gotten this wrong before. See CDRIVER-3031. And I suspect there may be other cases we aren't handling quite right. Let's exhaustively audit functions that return a cursor and make it clear how we're handling options, and use the IDL where possible to have consistent behavior.


Generated at Wed Feb 07 21:16:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.