[SERVER-70984] Decouple the concepts "in-place updates" and "index updates" Created: 01/Nov/22  Updated: 29/Oct/23  Resolved: 26/Apr/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0-rc0, 7.0.0-rc3

Type: Improvement Priority: Major - P3
Reporter: Arun Banala Assignee: Irina Yatsenko (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on SERVER-65364 Update logic should pass info about w... Closed
Duplicate
is duplicated by SERVER-74136 UpdateDriver can miss index update Closed
Related
related to SERVER-76390 Refine UpdateIndexData class so that ... Open
Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.0
Sprint: QE 2023-02-06, QE 2023-02-20, QE 2023-03-06, QE 2023-03-20, QE 2023-04-03, QE 2023-04-17, QE 2023-05-01
Participants:

 Description   

The current code has this odd logic to disable "in-place updates" if any of the indexes are being updated as part of the update operation. After SERVER-65364, we will no longer need to compute this global indexesAffected flag. This "in-place updates" is the only place where the indexesAffected flag will be used.

After a bunch of discussions, we've realized that the "in-place updates" is a concept of MMAPv1 storage engine, which had true in-place updates, where the old object and new object pointed to the same memory. So if the update affected secondary indexes those would still need to be updated because the index key isn't referring the same memory as oldObj / newObj. It should be safe to remove all logic that has in-place updates and index updates coupling.

As a consequence of removing the above mentioned code block, we'll be able to do a nice cleanup of the computation logic of indexesAffected flag.



 Comments   
Comment by Githook User [ 30/May/23 ]

Author:

{'name': 'Irina Yatsenko', 'email': 'irina.yatsenko@mongodb.com', 'username': 'IrinaYatsenko'}

Message: SERVER-70984 Remove now unused 'indexesAffected' flag from various structs in update
Branch: v7.0
https://github.com/mongodb/mongo/commit/6805bd38a7f7fb5ab7cc17827d88b2be800487fd

Comment by Githook User [ 30/May/23 ]

Author:

{'name': 'Irina Yatsenko', 'email': 'irina.yatsenko@mongodb.com', 'username': 'IrinaYatsenko'}

Message: SERVER-70984 Remove _affectIndices in UpdateDriver in favor of reporting index impact from updateDocument
Branch: v7.0
https://github.com/mongodb/mongo/commit/d2a58c685686eb757ffd55783e0ac36125e12a33

Comment by Githook User [ 26/Apr/23 ]

Author:

{'name': 'Irina Yatsenko', 'email': 'irina.yatsenko@mongodb.com', 'username': 'IrinaYatsenko'}

Message: SERVER-70984 Remove now unused 'indexesAffected' flag from various structs in update
Branch: master
https://github.com/mongodb/mongo/commit/1d616ae7969f19a082521718e8224454e9ce737b

Comment by Githook User [ 21/Apr/23 ]

Author:

{'name': 'Irina Yatsenko', 'email': 'irina.yatsenko@mongodb.com', 'username': 'IrinaYatsenko'}

Message: SERVER-70984 Remove _affectIndices in UpdateDriver in favor of reporting index impact from updateDocument
Branch: master
https://github.com/mongodb/mongo/commit/e187a5f91a8bf18fefbae4d7b3003bfe8ee89a6c

Comment by Irina Yatsenko (Inactive) [ 17/Apr/23 ]

I'm not sure about the linked BF. I wouldn't expect asking about whether indexes might be affected twice to drive the latency up that much. On the other hand, there was churn in the area so it's conceivable that the changes above or the remaining work for this ticket would improve perf. I'm looking at it right now.

Comment by Zixuan Zhuang [ 17/Apr/23 ]

irina.yatsenko@mongodb.com I see. I found this ticket because it is linked to a hot BF BF-27578, do those PRs solve the BF or we still need more steps?

Comment by Irina Yatsenko (Inactive) [ 17/Apr/23 ]

The linked PRs are merged but they represent partial steps towards the ultimate goal of the ticket.

Comment by Zixuan Zhuang [ 17/Apr/23 ]

irina.yatsenko@mongodb.com The linked PRs are all merged, can we close this ticket?

Comment by Githook User [ 08/Feb/23 ]

Author:

{'name': 'Irina Yatsenko', 'email': 'irina.yatsenko@mongodb.com', 'username': 'IrinaYatsenko'}

Message: SERVER-70984 Remove dead code for returning RecordId from UpdateDocument
Branch: master
https://github.com/mongodb/mongo/commit/f24843f504a422fb1c5dfcca796a5ad63ca4a242

Comment by Githook User [ 02/Feb/23 ]

Author:

{'name': 'Irina Yatsenko', 'email': 'irina.yatsenko@mongodb.com', 'username': 'IrinaYatsenko'}

Message: SERVER-70984 Do not block inplace doc updates just because of indexes
Branch: master
https://github.com/mongodb/mongo/commit/f235cce813e703afe90c07e83643840657a9450d

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