[CDRIVER-2332] New "with_opts" functions to support sessions with GridFS Created: 24/Oct/17  Updated: 13/Jan/20  Resolved: 13/Jan/20

Status: Closed
Project: C Driver
Component/s: GridFS
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-2331 New "with_opts" functions to accept s... Closed
related to CDRIVER-2643 Make the GridFS implementation spec c... Closed
is related to DRIVERS-2062 Modify GridFS spec to support session... Backlog

 Description   

For GridFS functions that do not accept generic "opts" in a bson_t, add new "with_opts" functions. This will allow applications to pass sessionId to GridFS functions. Deprecate superseded functions.

There are two options: continue to invest in our current GridFS API, which does not conform to the GridFS Spec, by adding the following variants:

  • mongoc_client_get_gridfs_with_opts
  • mongoc_gridfs_create_file_from_stream_with_opts
  • mongoc_gridfs_create_file_with_opts
  • mongoc_gridfs_drop_with_opts
  • mongoc_gridfs_file_remove_with_opts
  • mongoc_gridfs_file_save_with_opts
  • mongoc_gridfs_file_readv_with_opts
  • mongoc_gridfs_file_writev_with_opts
  • mongoc_gridfs_find_one_by_filename_with_opts
  • mongoc_gridfs_remove_by_filename_with_opts

Update the documentation for mongoc_collection_get_last_error.

This will make it easy for existing GridFS applications to use sessions. It preserves spec-violating features that applications depend on, such as mutable GridFS files.

The other, probably superior option is to deprecate our entire GridFS API and create a new spec-conforming one. This new API will be the only way to use sessions with GridFS in the C Driver.

Applications that use the C Driver's GridFS API are probably few, and they will have a small number of integration points with the API, and they will need to make code changes to use sessions with GridFS no matter what. Requiring some additional code changes is worth the cost in exchange for matching the GridFS Spec. The big obstacle is the loss of writable GridFS files; but I hope that applications can adapt to use the standard GridFS file versioning scheme instead.



 Comments   
Comment by Kevin Albertson [ 13/Jan/20 ]

Additionally, the new spec compliant mongoc_gridfs_bucket_* API accepts bson_t options. If SPEC-921 requires adding sessions/transactions/causal consistency, there may be no API change required.

Comment by April Schoffer [ 13/Jan/20 ]

SPEC-921 will sort out session support for the spec compliant GridFS API and we won't need this ticket.

Comment by A. Jesse Jiryu Davis [ 04/May/18 ]

Probably not do this ticket, in favor of CDRIVER-2643.

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