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

Support shard key metrics sampling

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Replication
    • Fully Compatible
    • Repl 2023-10-02, Repl 2023-10-16, Repl 2023-10-30, Repl 2023-11-13

      Each update/delete statement inside the ops field could contain an unstable sampleId field used internally for PM-1858. On mongos, currently WriteOp::targetWrites already handles assigning sampleId to TargetedWrite. And we simply need to attach the sampleId field to the sampled statement in bulkWrite before sending to shards. On mongod, when executing sampled statements, we need to construct sampled update/delete queries and add them to the QueryAnalysisWriter, similar to what update / delete does today. Additionally for update statements, we need to make sure we set up the sampleId correctly in the UpdateRequest so that QueryAnalysisOpObserver can work properly when storing the diff for a sampled write query. Last but not least, we need to make sure that query sampling handles WouldChangeOwningShard updates correctly for bulkWrite as well (SERVER-73255). But this may come for free if we reuse error handling logic from write_op_exec.cpp.

            Assignee:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Reporter:
            sean.zimmerman@mongodb.com Sean Zimmerman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: