Add rawData to query shape for write operations

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Overview

      The rawData flag is currently not included in the query shape for write operations (insert, update, delete, findAndModify). This means queries that differ only by the rawData flag will share the same query shape and aggregate their metrics together in the query stats store, even though their execution behaviour is fundamentally different.

      Background

      Today rawData is a flag is only relevant for timeseries collections. When rawData: true, the query operates directly on the raw timeseries bucket documents without unpacking them into user documents.

      SERVER-112940 addressed this for read operations (find, aggregate, count, distinct). This ticket covers the same fix for write operations.

      Scope of Work

      • src/mongo/db/query/query_shape/write_op_query_shape.cpp (or equivalent per-command shape files) — serialize rawData into the query shape when true; omit when false or absent
      • Corresponding _test.cpp files — add unit tests covering rawData: true, rawData: false, and absent cases
      • jstests/noPassthrough/query/queryStats/ — add JS integration tests verifying distinct query stats entries for write operations with and without rawData

        Acceptance Criteria

      • rawData: true produces a distinct query shape hash from rawData absent/false for update, delete, and findAndModify commands
      • rawData: false is normalized to absent and does not change the query shape
      • Query stats correctly separates metrics for rawData: true vs rawData: false/absent writes
      • Unit and integration tests added for all affected command types

        Technical Notes

      • Mirror the approach taken in SERVER-112940 for read commands
      • Query settings do not need to be considered — creating query settings with rawData: true is not supported

            Assignee:
            Unassigned
            Reporter:
            Arun Banala
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: