[SERVER-77189] Ensure UpdateNoIndexes is propagated correctly Created: 16/May/23  Updated: 31/May/23  Resolved: 31/May/23

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

Type: Task Priority: Major - P3
Reporter: Colin Stolley Assignee: Colin Stolley
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backport Requested:
v7.0
Participants:
Linked BF Score: 105

 Description   

When calling updateDocument() here:
https://github.com/10gen/mongo/blob/v7.0/src/mongo/db/exec/update_stage.cpp#L269-L281

Note that we compute the diff from the OpLog event, but there are only 2 choices: either the diff from the the oplog, or all indexes have been changed. But there is a third option: No indexes have changed. We need to pass that value through and handle it correctly in updateRecord() to avoid updating more indexes than we should, and to avoid going through the anyIndexesMightBeAffected() checks if it isn't needed.



 Comments   
Comment by Colin Stolley [ 31/May/23 ]

This has been obviated by SERVER-70984 . Previously we could probe driver->modsAffectIndices() to determine if no indexes were affected, thus savings us a bit of work in that case. We no longer compute this field due to SERVER-70984 , which ensures now that we're only computing affected indexes once instead of twice.

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