[SERVER-43908] Modify IndexConsistency hash-map keys to avoid hitting an invariant on duplicate index keys in KeyString form for different indexes Created: 09/Oct/19  Updated: 29/Oct/23  Resolved: 15/Oct/19

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.6.15, 4.3.1, 4.2.2, 4.0.14

Type: Bug Priority: Major - P3
Reporter: Gregory Wlodarek Assignee: Gregory Wlodarek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Problem/Incident
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2, v4.0, v3.6
Sprint: Execution Team 2019-10-21
Participants:
Linked BF Score: 50

 Description   

It's possible to hit this invariant as index key KeyStrings are created without their field names present in the KeyStrings.

For example, if we had the following document:

{ a: 1, b: 1 }

and two indexes on keys "a" and "b", then the KeyStrings for the index keys of the document would be identical as the field name in the KeyString is not present. The BSON representation of this would look like: { : 1 } for both.

So to distinguish index key KeyStrings, we should append the index name to the end of them.



 Comments   
Comment by Githook User [ 22/Oct/19 ]

Author:

{'name': 'Gregory Wlodarek', 'username': 'GWlodarek', 'email': 'gregory.wlodarek@mongodb.com'}

Message: SERVER-43908 Modify IndexConsistency hash-map keys to avoid hitting an invariant on duplicate index keys in KeyString form for different indexes
Branch: v3.6
https://github.com/mongodb/mongo/commit/4bcb6a10d72604930935b5c280f89d5c9ba29a42

Comment by Githook User [ 22/Oct/19 ]

Author:

{'name': 'Gregory Wlodarek', 'username': 'GWlodarek', 'email': 'gregory.wlodarek@mongodb.com'}

Message: SERVER-43908 Modify IndexConsistency hash-map keys to avoid hitting an invariant on duplicate index keys in KeyString form for different indexes
Branch: v4.0
https://github.com/mongodb/mongo/commit/30d9f90fdd2a2fcf197bdee465a55d63eb9cec5e

Comment by Githook User [ 22/Oct/19 ]

Author:

{'username': 'GWlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'name': 'Gregory Wlodarek'}

Message: SERVER-43908 Modify IndexConsistency hash-map keys to avoid hitting an invariant on duplicate index keys in KeyString form for different indexes

(cherry picked from commit 61e6100d1648fc70d532dab2ef21a7b19d4857a8)
Branch: v4.2
https://github.com/mongodb/mongo/commit/2c203d8c13aa795f8d007ffd57d0e0061ff160c7

Comment by Githook User [ 15/Oct/19 ]

Author:

{'name': 'Gregory Wlodarek', 'username': 'GWlodarek', 'email': 'gregory.wlodarek@mongodb.com'}

Message: SERVER-43908 Modify IndexConsistency hash-map keys to avoid hitting an invariant on duplicate index keys in KeyString form for different indexes
Branch: master
https://github.com/mongodb/mongo/commit/61e6100d1648fc70d532dab2ef21a7b19d4857a8

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