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

Remove handling of extra options for bulk write update/replace structs

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Bulk API

      _mongoc_bulk_operation_update_append takes an extra_opts parameter, which when non-empty is concatenated to bson_t opts and passed as the update statement options to _mongoc_write_command_update_append or _mongoc_write_command_init_update. At runtime, the extra_opts parameter provided to _mongoc_bulk_operation_update_append originates from the extra field on the corresponding bulk write option struct.

      Looking at generate-opts.py, all of the bulk write structs specify allow_extra=False, so the extra field on update/replace option structs should only ever be an empty document (initialized in the parse method and later destroyed in cleanup).

      If this analysis is correct, the extra_opts parameter should simply be removed from the various mongoc-bulk-operation.c functions.

      Notably, the delete operations do not reference extra at all. The insert operations do reference extra and pass it to _mongoc_write_command_init_insert as the cmd_opts, which is likely also dead code (to be removed in CDRIVER-4199 when introducing the top-level comment option).

            Assignee:
            Unassigned Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: