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

Support LOGV2 serialization for RuntimeEnvironment and PlanStageData

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Query Execution

    Description

      Currently classed PlanStageData and RuntimeEnvironment have debugString() methods:

      https://github.com/mongodb/mongo/blame/2ce7d457434f2b81924c32ead1fefce7d9e3a949/src/mongo/db/query/sbe_stage_builder_plan_data.h#L299

      https://github.com/mongodb/mongo/blob/master/src/mongo/db/exec/sbe/expressions/runtime_environment.h#L193

      However, they have different signatures:

      std::string debugString() and 

      void debugString(StringBuilder*).

      RuntimeEnvironment is accepting StringBuilder to avoid extra allocations when serializing it in PlanStageData::debugString().

      What we should do is:

      1. Add serialize(fmt::memory_buffer&) method to both functions. This way they can be serialized to already existing buffer, avoiding allocations and this signature is supported by LOGV2: https://github.com/mongodb/mongo/blob/master/src/mongo/logv2/attribute_storage.h#L173
      2. Add std::string debugString() to both classes, implementing it via serialize(). This way we can keep old signature.

      Attachments

        Activity

          People

            backlog-query-execution Backlog - Query Execution
            ivan.fefer@mongodb.com Ivan Fefer
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: