-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Server Programmability
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.
- related to
-
SERVER-91168 Accept command struct arguments instead of BSONObjs in internal transaction API
- Backlog
-
SERVER-85791 Only parse command request once in command processing path
- Closed