[SERVER-65439] Tenant Migration oplog applier may try to wrongly mark an index as multikey. Created: 11/Apr/22  Updated: 29/Oct/23  Resolved: 22/Apr/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc4, 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Suganthi Mani Assignee: Christopher Caplinger
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
is related to SERVER-60754 Setting multikey in _mdb_catalog can ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.0
Sprint: Server Serverless 2022-04-18, Server Serverless 2022-05-02
Participants:
Linked BF Score: 46

 Description   

After writing the record to collection table, we index records. While indexing records, we track any index keys that needs to be marked as multikey in the _mdb_catlog table for that collection, via opCtx decoration. And, we don't reset the tracker after marking the index as multi-key in the collection catalog entry. So, if write ops on different collection shares the same opCtx, we might wrongly mark an index as multi-key for a collection if the index keys of that collection has the same name as the multikey index name of the previously applied collection operation.

In tenant oplog applier case, write ops on different collection that's get applied by the same TenantMigrationWriter thread in a single batch, will share the same opCtx. This can lead either to tenant migration failure due to this error or silently marking a wrong index as mutikey on recipient primary.



 Comments   
Comment by Githook User [ 02/May/22 ]

Author:

{'name': 'Christopher Caplinger', 'email': 'christopher.caplinger@mongodb.com', 'username': 'UnicodeSnowman'}

Message: SERVER-65439: Conditionally set multikey paths when indexing records

(cherry picked from commit 51b92630cc5a6448de092c1c6a38c70d702c5153)
Branch: v6.0
https://github.com/mongodb/mongo/commit/bf5b9ae54fdb8ee506205d624b561bb94e7691a4

Comment by Githook User [ 21/Apr/22 ]

Author:

{'name': 'Christopher Caplinger', 'email': 'christopher.caplinger@mongodb.com', 'username': 'UnicodeSnowman'}

Message: SERVER-65439: Conditionally set multikey paths when indexing records
Branch: master
https://github.com/mongodb/mongo/commit/51b92630cc5a6448de092c1c6a38c70d702c5153

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