Details
-
Task
-
Resolution: Unresolved
-
Major - P3
-
None
-
None
-
None
-
Service Arch
-
Service Arch 2023-09-18, Service Arch 2023-10-02, Service Arch 2023-10-16
Description
There are several calls to BSONObj::getField that are made by functions called by RunCommandImpl::_epilogue. These are chiefly CommandHelpers::extractOrAppendOK and mongo::getStatusFromCommandResult. These command parsers can be consolidated with the help of an IDL generated parser to reduce the amount of parsing of the BSON reply.
Also, CommandHelpers::checkForInternalError can be made debug only to avoid yet another pass over the reply.
Example of the reply fields that can be consolidated in an IDL definition:
CommonReplyArgs:
|
description: TODO
|
strict: false
|
unsafe_dangerous_disable_extra_field_duplicate_checks: true
|
fields:
|
ok:
|
type: safeBool
|
optional: true
|
code:
|
type: safeInt
|
optional: true
|
errmsg:
|
type: string
|
optional: true
|
$err:
|
cpp_name: dollarErr
|
type: string
|
optional: true
|
writeConcernError:
|
type: object
|
optional: true
|
Note: There may be opportunity to align with the reply fields defined in src/mongo/idl/generic_argument.idl. On the other hand, a more narrow parser for this error handling will be better then a wider parser handling all generic reply fields.
POC: https://github.com/markbenvenuto/mongo/tree/tiger_perf_bson
Attachments
Issue Links
- is related to
-
SERVER-80296 Refactor command request processing path to reduce BSON parsing passes
-
- Closed
-
- split to
-
SERVER-82091 Add a benchmark for ServiceEntryPoint
-
- Closed
-