Do not validate options in read/write agnostic command helpers

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Unassigned
            Reporter:
            Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: