[SERVER-73931] The 'AutoGetCollectionForReadLockFreePITCatalog' utility can mismatch the Sharded and StorEx parts of a collection Created: 13/Feb/23  Updated: 27/Oct/23  Resolved: 20/Mar/23

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

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Henrik Edin
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
causes SERVER-74836 AutoGetCollectionForReadLockFreePITCa... Closed
Related
Assigned Teams:
Storage Execution
Operating System: ALL
Sprint: Execution Team 2023-03-06
Participants:
Linked BF Score: 135

 Description   

The newly introduced AutoGetCollectionForReadLockFreePITCatalog utility first snapshots the CollectionPtr object from the StorEx catalog and then attaches it a description. This is incorrect, because while the StorEx catalog can read at a point-in-time, the Sharding one cannot and always returns "latest". Because of this it is possible that an older collection content can be wrongly paired with a newer description, thus rendering the shard key application nonsensical.

Until CSS::getCollectionDescription is made timestamp-aware, a check needs to be performed based on the UUID of the collection to ensure that the two can be paired and SnapshotTooOld exception should be thrown.

Note that in practice, this is not possible to hit, because the Router Role is not going to find a history across drop/recreate so any queries will fail there.



 Comments   
Comment by Githook User [ 20/Mar/23 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: Revert "SERVER-73931 Verify that collection UUID matches with sharding"

This reverts commit daa375e72b57bb45f5913cb60118bdc415400036.
Branch: master
https://github.com/mongodb/mongo/commit/1e6c0f304205c96f91fc4440965c363321f11e4b

Comment by Githook User [ 02/Mar/23 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-73931 Verify that collection UUID matches with sharding
Branch: master
https://github.com/mongodb/mongo/commit/daa375e72b57bb45f5913cb60118bdc415400036

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