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

Fast bsonExtract handling for NoSuchKey + no default, in non-error case

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Sprint:
      Platforms 2017-06-19

      Description

      The bsonExtract* methods in bsonExtract.cpp are often used to both determine whether a field exists and in the case it does parse out of a BSONObj, with both results being considered valid. In the case where a field does not exist we generate an error Status object and build an error message using str::stream() both of which are expensive operations for a non-error path.

      We should consider adding methods (or modifying current ones) to support extraction or fast NoSuchKey return in the case the field doesn't exist (without return of an error Status object). This ticket should focus on the methods outside of the "WithDefault" ones, which will be handled under SERVER-27263.

      After completing this ticket we should perform an audit of the code base and enter follow-on tickets to address cases where NoSuchKey is being handled after bsonin a non-error situation. A few (out of many) examples of this:

      1. extensions_callback.cpp
      2. collator_factory_icu.cpp
      3. replset_commands.cpp

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: