[SERVER-71269] Use compact diff format for updates to arrays using classic $set, $pop, $pull Created: 10/Nov/22  Updated: 06/Oct/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Katya Kamenieva Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: ians-backlog
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-71331 Do not record full array in oplog for... Closed
is related to DOCS-16424 [SERVER] Describe what to expect from... Backlog
is related to SERVER-72941 Use compact diff format for updates t... Closed
Assigned Teams:
Query Execution
Participants:

 Description   

When using classic update language with operators $set, $pop, $pull to add/remove an element from the array, it writes down the new value of the array to the oplog, and leads to large change stream events.

Instead we could use compact diff so that the resulting change stream event would include:

updateDescription: { updatedFields: { 'arrayField.3': 4  }, ...  }}

or 

{{{ updateDescription: {..., truncatedArrays: [ { field: 'arrayField', newSize: 3 } ] } } }}

 



 Comments   
Comment by Katya Kamenieva [ 17/Jan/23 ]

I filed a separate ticket for $addToSet SERVER-72941, as it seems like the most feasible sub-task from this bucket. For the rest of the operators, the work is pretty substantial, and there is no strong-enough reason today to invest in this effort.

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