Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-91316

Accept command struct arguments instead of BSONObjs in Shard API

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

      The Shard interface accepts command arguments in a number of different forms, though it mainly accepts them as arbitrary BSONObjs. The implementation of such methods checks for the presence of and appends many different sharding-related fields to the request documents, and this involves linear scans of the BSON and reallocations of the document, which is error prone and not performant.

      Instead, we should replace these methods with ones that only accept IDL-generated command structs, as this will let the implementation inspect/modify these fields without doing expensive lookups. This will also make the code a lot easier to read and maintain, as well as making it more type safe and robust to future bugs. This is possible now that all IDL-generated commands include generic arguments (e.g. maxTimeMS), which was introduced in SERVER-85791.

            Assignee:
            Unassigned Unassigned
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: