[SERVER-60754] Setting multikey in _mdb_catalog can be out of timestamp order Created: 15/Oct/21  Updated: 29/Oct/23  Resolved: 10/Mar/22

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

Type: Bug Priority: Major - P3
Reporter: Yuhong Zhang Assignee: Daniel Gottlieb (Inactive)
Resolution: Fixed Votes: 0
Labels: techdebt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-65439 Tenant Migration oplog applier may tr... Closed
is related to SERVER-60037 Enable the ordered timestamp assertio... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

1. Start a replset
2. In a mongo shell run (the order of the indexes and documents matter)

db.test.createIndex(\{b: 1})
db.test.createIndex(\{a: 1})
db.test.insert([\{a: [1, 2]}, \{b: [1, 2]}])

Sprint: Execution Team 2021-11-01, Execution Team 2021-12-13, Execution Team 2021-12-27, Execution Team 2022-01-10, Execution Team 2022-02-07, Execution Team 2022-02-21, Execution Team 2022-03-07
Participants:

 Description   

When inserting a batch of documents and indexing them, we will loop through the ready indexes, and then for each index we will loop through the documents. If a later document with a higher timestamp causes an earlier index to become multikey, the write to _mdb_catalog will use the higher timestamp. If then an earlier document causes a later index to become multikey, the second write to the catalog will use the earlier timestamp, which is out of order.



 Comments   
Comment by Githook User [ 09/Mar/22 ]

Author:

{'name': 'Daniel Gottlieb', 'email': 'daniel.gottlieb@mongodb.com', 'username': 'dgottlieb'}

Message: SERVER-60754: Ensure primaries write multikey paths in timestamp order.
Branch: master
https://github.com/mongodb/mongo/commit/bc8142405dec99dd24cb87b2f61570c600d6f0d4

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