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

Do not validate options in read/write agnostic command helpers

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      libmongoc has several generic command helpers that are read/write agnostic.

      • mongoc_client_command()
      • mongoc_client_command_simple()
      • mongoc_client_command_simple_with_server_id()
      • mongoc_client_command_with_opts()
      • mongoc_database_command()
      • mongoc_database_command_simple()
      • mongoc_database_command_with_opts()
      • mongoc_collection_command()
      • mongoc_collection_command_simple()
      • mongoc_collection_command_with_opts()

      These helpers should not be inspecting or validating options supplied by the user.

      See this PR conversation for context: https://github.com/mongodb/mongo-c-driver/pull/662#discussion_r454365303

      For example, most go through _mongoc_client_command_with_opts will call mongoc_cmd_parts_append_read_write to apply command options. In doing so, the server's wire version is checked for read/write concern support. This directly contradicts the read/write concern spec.

      Let's audit these helpers to and remove unnecessary validation.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: