[SERVER-77871] Support shard key metrics sampling Created: 07/Jun/23  Updated: 01/Dec/23  Resolved: 06/Nov/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Task Priority: Major - P3
Reporter: Sean Zimmerman Assignee: Lingzhi Deng
Resolution: Fixed Votes: 0
Labels: milestone-2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-82826 Unittest coverage for shard key metri... Closed
Related
is related to SERVER-82382 Batch/Bulk write size estimation logi... Needs Scheduling
Assigned Teams:
Replication
Backwards Compatibility: Fully Compatible
Sprint: Repl 2023-10-02, Repl 2023-10-16, Repl 2023-10-30, Repl 2023-11-13
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 06/Nov/23 ]

Author:

{'name': 'Lingzhi Deng', 'email': 'lingzhi.deng@mongodb.com', 'username': 'ldennis'}

Message: SERVER-77871: Support shard key metrics sampling for bulkWrite
Branch: master
https://github.com/mongodb/mongo/commit/6ab71db2613a4c1f9a4b43d5875990955015d1d7

Generated at Thu Feb 08 06:36:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.