Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2332

New "with_opts" functions to support sessions with GridFS

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: GridFS
    • None

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: